Sign in to follow this  
Mastadex

Rendering both sides of a mesh.

Recommended Posts

Mastadex    200
I think the term for this is culling?? Correct me if Im wrong. What I want to do is have a face of a mesh be shown on both sides so when I rotate the mesh around it doesnt disapear half way. What are the steps involved? Im know, im a n00000b.

Share this post


Link to post
Share on other sites
BornToCode    1185
What api are you using OpenGL or D3D. If you are using D3D you need to used a pointer of LPDIRECT3DDEVICE9 to ascess to SetRenderState
for example.
LPDIRECT3DDEVICE9 d3ddevicce9;
d3ddevice9->SetRenderState(D3DRS_CULLMODE,D3DCULL_NONE);


I do not rememeber how to do it in OpenGL.

Share this post


Link to post
Share on other sites
LucidIon    198
Just in case: under OpenGL disable culling do:
glDisable(GL_CULL_FACE);

By default OpenGL doesn't perform culling.

A useful thing to do can be to draw the front faces solid and the back faces as wireframe. (If you are having orientation problems.)

Under OpenGL, this would be:
glPolygonMode(GL_FRONT, GL_FILL);
glPolygonMode(GL_BACK, GL_LINE);

By default both front and back are filled.

I don't know about DirectX.

Share this post


Link to post
Share on other sites
Mastadex    200
ok cool.

Im using D3D. One problem i noticed is that if i turn it on, my graphics look a little garbled. especially if they are far in the distance.

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