I want to draw the camera for debug.
But when I put the createCameraFrustum(Camera CAM) in the Update() I drew a lot of Camera wireframes on the screen.
How can I change this code so that it doesn’t draw too many camera wireframes when it goes into update(). Problem description Effect of target
When running to this location in update the camera changes and this causes the initialization of frustumGeo to be in the wrong location.
FrustumGeo is now initialized
How do I change the location where frustumGeo has been initialized
First you were asking about getting the camera debug cone in the right place. Now you seem to be asking about something totally different.
updateLogicalState() is what JME calls on the scene graph to make EVERYTHING WORK. It’s what updates all the stuff. It updates the controls. It updates and dirty state. It updates all the stuff.
It is unrelated to any issue that you could be possibly having except for execution order (things may be a frame behind).
Get the simple things working first. Then worry about the hard stuff.
When I deleted frustumGeo from update(), there would only be one frustumGeo in the wrong place. I started to find out what caused frustumGeo to appear in the wrong place
This is my debug(I found myself going further and further along in my mistakes )
The camera does not return the correct value until the update() is run the first time
Any suggestions for getting FrustumGeo initialized in the right place
Initialize frustumGeo once in initialize().
Initialize frustumGeo once in initialize().
Initialize frustumGeo once in initialize().
Initialize frustumGeo once in initialize().
Just the one time.
Only once.
just once.
In initialize.
So that it is only created once. So there is just one of them. Not 5,000,246,262,216 of them.
Just one.
In initialize().
Attach it to the root node just once in initialize(). Just the one time.
Update it’s location every frame in update().
By setting its world location to the same as the camera’s world location.
spatial.setLocalTranslation(camera.getLocation());
By settings its world rotation to the same as the camera’s world rotation.
spatial.setLocalRotation(camera.getRotation());
When I find that I can’t initialize the cone frame position correctly
I revisited this link to see if I missed anything
When I see cam.clone() browsed through the API and found that this was a copy camera
Copy the camera and modify the value so that the cone box is displayed in the correct position
I’m going to start the experiment of the collision between the X-ray camera and the wall