Apply texture to two opposite sides of a quad.

Started by
10 comments, last by langtudontinh 19 years, 1 month ago
Hi everyone! I have two textures and want to apply these into 2 sides of a quad. Could anyone show me the way? Thank you. ltdt.
Advertisement
Disable backface culling:
Device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
I think we should enable back-face culling.
You can't apply two textures to one quad, you need to make a second quad, which is at the same location but faces the opposite direction.

edit to clarify: disabling backface culling would show the texture of the quad on the other side as well (but mirrored). I don't think that's what you want...
Yeh, that's thing I need.
Thank you.
Or, determine which side of the quad is facing the camera (simple dot product) and assign the texture that corresponds with that side.
Quote:Original post by Amodim
Or, determine which side of the quad is facing the camera (simple dot product) and assign the texture that corresponds with that side.


Pls describe more detail about "simple dot product" to check which side is facing the camera.

ltdt.
There is another problem arises, How could I generate the opposite order vetices from a mesh?
Quote:Original post by langtudontinh
Hi everyone!
I have two textures and want to apply these into 2 sides of a quad. Could anyone show me the way?
Thank you.

ltdt.

You could use only one quad and rendering it two time per frame. That is: Render it once with the texture 1. Set the texture 2, rotate the quad by 180 degrees and render it again.
I have some more question:
Could I apply 2 texture into 2 sides (by turning culling on) while tweening (morphing) from a quad into a cylinder???

This topic is closed to new replies.

Advertisement