Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

GarethThomas

3d Engine Stuff

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

Hi there! I''m currently writing a FPS engine and have two questions: 1) I used to use a glu cylinder as the weapon and rendered it last with the depth test off (just like Trinity) - this stopped the weapon from disappearing into the walls etc... Now I''m using a weapon constructed from triangles and this needs the depth buffer. How can I make the weapon draw over the walls? 2) I''m using planes to define the visible volume. I''m then using these planes to determine the visible polys in that sector. I can calculate these planes when looking through my portals (the planes are calculated using my position and the edges of the portal). This all works fine but I get a bit (very) confused when calculating the planes for the sector I am in. How are the four planes defined in world space for the initial FOV? Thanks in advance for the help.

Share this post


Link to post
Share on other sites
Advertisement
1) Don''t disable the depth test!
Do it like this:

render world
glDepthRange (0, 0.3);
render weapon
glDepthRange (0, 1);

Bruno

Share this post


Link to post
Share on other sites
Thanks guys for your help.

The depth range suggestion worked a treat.

The FAQ sample code ViewCull.c solved my view frustum problems straight away. I''m sure there is a more direct way to calculate the frustum planes - it''s just that I can''t get my head around the trig! However, the current solution will do just fine for now.

Share this post


Link to post
Share on other sites

  • 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!