Jump to content
  • Advertisement
Sign in to follow this  
William_Fagerstrom

OpenGL OpenGL oblique projection

This topic is 3031 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 gamedev, its been a little while since I have made a post here but I have problems again... This time its OpenGL. Image As you can see in that image the oblique, flat shaded image is all messy... Things being draw over the top of each other, any ideas on why this could be happening? Also, if you want to compile Here is my source . Another question is; am I doing it right? :P I am using a load of glEnables in the display functions is that correct? Or is there some way of doing all of that in some sort of loading phase. Oh and the animated window seems to have lots of tearing for me, anyone else get this? I am on a shit computer... But still seems like it shouldn't. Is there anyway I can optimize my solution? Thanks in advanced, William.

Share this post


Link to post
Share on other sites
Advertisement
Your oblique matrix seems to be missing a 1 at (3,3). Your current matrix drops the Z-component, effectively eliminating any depth information.

Share this post


Link to post
Share on other sites
Oh, and your second question also...

You have to be careful where you enable things. Yes, you can enable whatever you want in the init-function. But be aware that you have effectively enabled it globally, even where you don't expect it to be enabled.

I'm not a big fan of doing these types of global enables in the init-function. If I leave the state at its default, I enable things explicitly when I want them, and I then disable them as soon as I'm done with it. I don't risk leaving states enabled that causes problems in other parts, which assumes some states to be disabled.

Some fundamental things, like depth test, can be enabled globally, because I need it more often than not, and I know depth test is enabled by default in my applications, as opposed to being disabled like any other state. Referring to your code, you can move things like setting depth mask, and face culling in the init-function to have a reasonable default value, but leave the enables where you need them, and don't forget to disable them as soon as you're done with them; that is, just after your glEnd.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!