Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

Looping textures

瀏覽次數:8 次
跳到第一則未讀訊息

Oenone

未讀,
2005年12月1日 下午5:13:422005/12/1
收件者:
I've created an object in my vertex buffer which forms a tube around the
y-axis, and I'm rendering it using DrawIndexedPrimitive, such that the
points where the start and end of the tube meet are the same points in my
index buffer.

I've wrapped a texture on to the tube, and it looks fine, but because the
texture's u coordinate is 0.0 at the start of my tube and 0.9 at the other
end, the join between these two points (where the tube end joins back up
with the tube start) repeats the entire texture, compressed into a tiny
space and back-to-front.

I'm sure I have read about an easy way of stopping the texture from doing
this, so that in this section the texture coordinates will range from 0.9 to
1.0, instead of 0.9 to 0.0. Have I imagined this? And if not, could someone
remind me what I need to do?

Many thanks,

--

(O)enone


Robert Dunlop [MS MVP]

未讀,
2005年12月1日 下午5:31:072005/12/1
收件者:
"Oenone" <oen...@nowhere.com> wrote in message
news:qAKjf.7052$xP2....@newsfe2-gui.ntli.net...

d3dDevice->SetRenderState(D3DRS_WRAP0, D3DWRAPCOORD_0);

That'll specify that U coordinates are wrapped for texture stage 0.

--
Robert Dunlop
The X-Zone
http://www.directxzone.com/
Microsoft DirectX MVP
-------------
The opinions expressed in this message are my own personal views and do not
reflect the official views of the Microsoft Corporation.
The MVP program does not constitute employment or contractual obligation
with Microsoft.


Oenone

未讀,
2005年12月1日 下午6:22:292005/12/1
收件者:
Robert Dunlop [MS MVP] wrote:
> d3dDevice->SetRenderState(D3DRS_WRAP0, D3DWRAPCOORD_0);
>
> That'll specify that U coordinates are wrapped for texture stage 0.

Perfect -- many thanks for that.

--

(O)enone


0 則新訊息