near clipping plane problems

Started by
3 comments, last by Bit-Field 19 years, 11 months ago
okay well im making a FPS, but when im rendering the gun the back of it is see through due to the near clipping plane not being small enough (1 unit is 1 meter for me) so i had to set it to 0.2f, and that works for the guns, but i notice some other stuff doesnt work (like the water rises above the terrain if i am too high (but if i set it to 1 the water wont rise above the terrain until i am ridiculously high)... so i think my question is, is there a way to render the guns while ignoring the near clipping plane? (so the back isnt culled out)?
Advertisement
You could always render the scene, clear the Z buffer, set a new projection matrix and render the gun.
yeah i tried changing the projection matrix when rendering the gun but it made it come out huge compared to the level for some reason...guess thats how projection works heh
quote:Original post by Bit-Field
yeah i tried changing the projection matrix when rendering the gun but it made it come out huge compared to the level for some reason...guess thats how projection works heh


Try again. But this time make sure that only the near and far clip plane distances are changed and that the angle-of-view is not changed.
Are you using the depth buffer? If so, try upping the bits per pixel, unless you are already at 32bpp. Sometimes artifacting is caused by the depth buffer rounding off (i.e. it rounds 30000.4321 to 30000). If the depth buffer does round if, it causes two pixels to be shown at the same place (hence artifacting).

Bit-Field has a good idea, find a command in whichever API you are using that will only change the near/far clipping planes.

--------------------------------------------------------------------------------
Good Links: C++ Reference, Java API
SDL Home Page, Lua Scripting Language, Python Scripting Language
Chris Taylor's Design Document (Downloadabe MS-Word Only), Blitz Basic Homepage

[edited by - Onemind on May 29, 2004 11:36:37 PM]

This topic is closed to new replies.

Advertisement