I've been having an issue with culling when using a fixed camera. When I try to position the camera so that it has a good perspective on the course, moving the marble to various parts of the course cause either (a) the marble to disappear or (b) part of the course to disappear. This doesn't happen when I use the chase camera.
A little experimenting suggests that I may have been positioning the camera in an invalid manner. I was using cam.getLocation().set() and cam.setDirection(). The problem seems to go away when I instead modify cam.getLocation().y and call cam.lookAt().
Update 2007-08-08: I immediately ran into problems with Camera.lookAt() in that the method seems to point the camera at the specified location by first tilting the vertical axis along the z-axis and then swiveling the camera left or right as required. This poses no problem when looking at an object ahead of the camera, but if the camera actualy has to look to the left or right, the image appears tipped over. For a while I went back to fiddling with adjusting the camera axes and direction manually but ultimately gave up; if I want to figure out how to point the camera without culling side-effects I'm probably going to have to study the lookAt method source code. I ultimately was able to get lookAt to work by specifying a top (argument 2 of the lookAt method) that points the camera in the direction of the target, so no left or right swivel is required.
Monday, August 06, 2007
jME CVS Update
I decided to update my jME source code from the CVS repository in case the weird culling behavior I've been seeing is the result of a jME bug that's been fixed. I selected CVS > Update all files. This ran for a while. But then when I tried to do a Clean and Build Project on my marble game I got all sorts of errors. Selecting "Resolve Reference Problems" from the project right-click menu revealed a long list of missing jars. Then I remembered that there was an extra step to get jME into jars instead of class files: right-clicking on the jME build.xml file and selecting Run target > dist-all. That seems to have cleaned up the broken references.
The next problem: two compile errors regarding LoggingSystem.getLogger(). According to the JavaDoc class LoggingSystem is deprecated; it looks like it no longer has any methods. The doc suggests using Java's Logger class instead. I modified my code by following the example in TestMarble.java.
Everything is fine now. Except the culling issue has remained. :o\
The next problem: two compile errors regarding LoggingSystem.getLogger(). According to the JavaDoc class LoggingSystem is deprecated; it looks like it no longer has any methods. The doc suggests using Java's Logger class instead. I modified my code by following the example in TestMarble.java.
Everything is fine now. Except the culling issue has remained. :o\
Subscribe to:
Comments (Atom)
