Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Looping textures

8 views
Skip to first unread message

Oenone

unread,
Dec 1, 2005, 5:13:42 PM12/1/05
to
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]

unread,
Dec 1, 2005, 5:31:07 PM12/1/05
to
"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

unread,
Dec 1, 2005, 6:22:29 PM12/1/05
to
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 new messages