Sign in to follow this  

OpenGL Direct 3D specify front faces

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this