3d Engine Stuff
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.
1) Don''t disable the depth test!
Do it like this:
render world
glDepthRange (0, 0.3);
render weapon
glDepthRange (0, 1);
Bruno
Do it like this:
render world
glDepthRange (0, 0.3);
render weapon
glDepthRange (0, 1);
Bruno
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement