I have 3 problems

I have a couple problems I wanted to see if anyone could help me with.

Number 1: Is there a way to have text in the game world rather than on the gui so it will display a number below a building even when you are moving the camera?

Number 2: The objects in my game look like they are leaning a lot when they get close to the edges of the camera. Any idea how to fix this or is this just how it will look. (this is more a problem that my professor has than I do) Heres a screenshot.


Number 3: Is there a way to change the bounding boxes of objects in jmonkey?

Thank you all.

  1. yeah, you can add bitmaptext to the world but you should rather add it to the gui and then write a control that uses cam.worldToScreen() to move the text with a spatial on screen
  2. you can enable orthogonal view mode using camera.setParallelProjection()
  3. that makes no sense, you change the meshes of the contained geometry and then the bounding box size changes. the bounding box is… the bounding box ^^, its a value derived from other factors

Thank you. I will get on trying that for number 1 and 2. I didnt know about the worldToScreen function.

For number 3, its the fact that I have to physically click on that tower to move it. My professor feels its too difficult to actually click on it so he wanted me to find a way so you dont have the spaces between the metal beams that dont allow you to click on it. So I wanted to see if there was a way to create a new bounding box around it somehow or something to fix that problem.

I don’t understand, you don’t have to hit the actual geometry, the whole bounding box should be clickable as long as you don’t just check for geometry being hit. So you should get a collision for the node as well.

Maybe I am checking the geometry not the bounding boxes. I dont see a way to be checking the bounding boxes. The only one I see is getCollision(0).getGeometry();

Also, the setParallelProjection() function didnt fix anything. I tried making it true and false and it was the same either way.

Well a crappy workaround would be a invisible box attached to the tower XD

The better way would be to find out how to do the collision checks based on boundingbox, ot alternativly modify the model to not have actual beams, but semi transaprent textures with the beams on it at the sides.

I didnt make the model nor am I able to get in touch with my friend who did. I was actually considering an invisible box too haha. Its fine. Ill figure it out or tell him I cant do anything.

Any other idea for my camera issue?

Im using the flyCam if that makes any difference.

If you want to allow collision in between the beams then you don’t want to edit the bounding box, you want to use the bounding box for collision instead of the actual geometry. In that case, you need BoundingVolume.intersects(Ray).

For parallel projection, see TestParallelProjection example

Can I get the bounding volume from the raycast?

lol, you get a geometry, it has as getWorldBounds() method :roll: