Advertisement Jump to content
Sign in to follow this  

OpenGL Direct 3D specify front faces

This topic is 4937 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In OpenGL when I need to specify front faces vertex order I use glFrontFace(GL_CW/GL_CCW) function How to do the same thing it D3D? I tried to do it using: pDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW(D3DCULL_CW) ); But this function call doesn't seem to do anything no matter what I specify D3DCULL_CCW or D3DCULL_CW. Help me please, I'm confused.

Share this post

Link to post
Share on other sites
Original post by ReaVeR-Andrey
It's inverse (specifying D3DCULL_CW means that clockwise faces should not be drawn): that was my big mistake for a long time.

Yes, I know that it's inverse since D3D uses left handed coord system. But my problem is that this function doesn't seem to change front faces at all.

Original post by Coder
The function does work. You've got to be doing something wrong.

I probably do smth wrong.
Here is a code snippet:

pDevice->SetTransform(D3DTS_WORLD, &World);
pDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW);
pDevice->SetRenderTarget(0, pRenderSurface[1]);
pDevice->Clear( 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(155, 0, 0), 1.0f, 0);
setup_reflection_transform_d3d(pDevice, vec3(0,0,0), vec3(1,0,0), vec3(0,1,0) );

[Edited by - glJack on July 18, 2005 7:18:52 PM]

Share this post

Link to post
Share on other sites
Thanx for help gyus!
I fixed the bug. Now everything works fine.

It was my fault :) I just called SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW) in a wrong place..

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!