Code archives/3D Graphics - Maths/Infinite far clipplane
This code has been declared by its author to be Public Domain code.
Download source code
| |||||
This code creates an infinitive far clipplane. You need to download the direct x 7 dll which is included to my shadow system on www.devil-engines.net . you also need to initialize and free the dx7 dll like in the sample below. Note: If you are already using my shadow system, you don't have to call this code. the shadow system will do it. also you MUST use freedx7() at the end. | |||||
Type DX7_Matrix Field m1#, m2#, m3#, m4# Field m5#, m6#, m7#, m8# Field m9#, m10#, m11#, m12# Field m13#, m14#, m15#, m16# End Type Function InitDX7() If DX7_SetSystemProperties(SystemProperty("Direct3D7"), SystemProperty("Direct3DDevice7"), SystemProperty("DirectDraw7"), SystemProperty("AppHWND"), SystemProperty("AppHINSTANCE")) Then RuntimeError "Error initializing dx7." If DX7_GetStencilBitDepth() < 8 Then DX7_CreateStencilBuffer() If DX7_GetStencilBitDepth() < 8 Then RuntimeError "Graphic card does not support stencil buffers." End If End Function Function FreeDX7() DX7_RemoveSystemProperties() End Function Function DX7_InfiniteFarClipPlane() m.DX7_Matrix = New DX7_Matrix DX7_GetTransform 3, m m\m11# = 1 m\m15# = -.1 DX7_SetTransform 3, m Delete m End Function |
Comments
None.
Code Archives Forum