View spatial objects that are really far

Hi,



I have some very big spatial TriMesh based objects displayed in my scene graph. I have noticed that going 10000 units away from them (their center) makes them invisible. Can I set this value to a greater one?



Thanks,



Dan

Yes, you have to change the far plane of your Camera (read the javadoc of the methods of Camera and you'll probably get what I mean with that).



The further away you set that though, the less accuracy you'll have in your ZBuffer (the buffer your videocard maintains to test when you draw something if it is behind or in front of what is already drawn). There's some good explanations of this around the forum, and one on mojomonkey's blog (linked on the frontpage).

Thanks for the reply!



I tried to do the following, but I cannot see any change in behavior:

[pre]

    cam.setFrustumPerspective(0, 1.5f, 0, 20000);

    cam.setFrustumFar(20000);

[/pre]



Dan

    /**
     * <code>setFrustumPerspective</code> defines the frustum for the camera.  This
     * frustum is defined by a viewing angle, aspect ratio, and near/far planes
     *
     * @param fovY   Frame of view angle along the Y.
     * @param aspect Width:Height ratio
     * @param near   Near view plane distance
     * @param far    Far view plane distance
     */
    public void setFrustumPerspective( float fovY, float aspect, float near, float far );



0 for fovY seems pretty odd?  Are you sure you aren't being overridden elsewhere in the code?

Right, I was overridden from the SWTCompositeGame I am using. It's working fine now, thanks!



Dan