Jump to content
  • Advertisement
Sign in to follow this  
bilsa

OpenGL making the object look like 3D?

This topic is 5410 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

Hello :) I just started out with 3D and I'm working with OpenGL. So far I have done some nice Vertex/Face/Polygon classes that work nice and I have made a simple .3DS loader. The objects are loaded just fine, and when I texture them they look somewhat like 3D :) But the thing is that lets say I load a human model from a .3DS model and don't apply any textures to it then the model looks like a flat "shit" :~ I'm guessing I would need some lightning/shadows or something? Normals + lightning, would that be it? I mean... even though the model is in one color... it should be shaded somewhat, depending on the curvature. Thank you for any help!

Share this post


Link to post
Share on other sites
Advertisement
If your material in the model is just colors (no textures) you must enable light:

pDevice->LightEnable(0, TRUE);
pDevice->SetRenderState(D3DRS_LIGHTING, TRUE);

And maybe even set some sort of light source for a nice result:

D3DLIGHT9& light
light.Type = ...
:

pDevice->SetLight(0, &light);




Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net 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!