Re: [PyOpenGL-Users] clipping? far image question
Brought to you by:
mcfletch
From: Black <py...@bl...> - 2008-05-23 13:53:56
|
On May 22, 2008, at 10:59 PM, Astan Chee wrote: > Hi, > I am trying to see how big/far my objects can be in (py)opengl. I > thought there was no limit and everything should be visible but a > sphere > with radius 70 and the camera is 150 units away, only half of the > sphere > is visible. What is causing this? Is it plane clipping? How do I set > it > so that it renders regardless of distance and size? Im not after > performance so I dont care if it is slow. > Cheers > Astan > PS: Here is the code I use: > > gluPerspective(45, 1.0*width/height, 0.1, 100.0) This line sets the far clipping plane to be 100 units out from the camera. As you are 150 units away and the sphere has a radius of 70 you are seeing the outer 20 units of the sphere. There isn't really a way to make it render "regardless of distance and size". The concern with increasing the size of the viewing volume isn't actually performance, it is that when the difference between the near and far planes grows, the accuracy of the depth calculations decreases. As we don't know what you are trying to do, it is hard to advise you as the best approach to take. |