Fixed background with respect to the camera

I am working with stereoscopic and I need to put a background fixed with respect to the camera.

This means that if you move the camera, the object representing the background (e.g. a Quad) move with the camera and appear fixed relative to the screen.

Anyone know how?

Thanks you!

Pablo



Estoy trabajando con estereoscop

Are you talking about a Skybox?



If so, here’s the API: http://www.jmonkeyengine.com/doc/com/jme/scene/Skybox.html



And here’s an example that shows how to implement it: http://www.jmonkeyengine.com/wiki/doku.php/starter:hello_intersection

Hi, thanks for your answer, but not yet found the result he wanted.

I used Skybox and what I did in the example, but the Skybox is still moving relative the screen when the camera rotates. Is there a way to fix the camera to an object, so that this will always remain quiet relative the camera? I want a fixed background!

Thanks you



Hola, gracias por tu respuesta, pero aún no encontré el resultado que buscaba.

Utilicé lo de Skybox e hice lo del ejemplo, pero el Skybox se sigue moviendo con respecto a la pantalla cuando la cámara rota. ¿No hay una manera de fijar a la cámara un objeto, para que este permanezca siempre quieto con respecto a la cámara? Quiero un fondo fijo!

Gracias

Hey hey…



did you find the solution to the fixed background problem? I’m interested in a solution, too, of course



cheers,

a.

Hm, if the worls is not to large, try a giant sphere with texture on the inside around it.

Ah… i just settled for transparent foreground image :slight_smile: simple to implement and just as effective (my goal was to have a watermark,)



cheers,

a.

Just attach the skybox to camera, and no to rootNode

Just set the cullstate of the sky sphere to never or use the new SkyFactory class to create working skyboxes easily.

Thanks to all for your answers, but still I have not found the way that a texture background does not move with respect to the camera.



Trovolone: How does the skybox is attached to the camera? For rootNode is

rootNode.attachChild (skyBox);

but with the camera the following sentence gives error:

cam.attachChild (skyBox);

The camera has not the attach function. How do you doing?



Gracias a todos por sus respuestas, pero aún no he encontrado la forma para que un fondo texturado no se mueva con respecto a la cámara.

Trovolone: ¿Cómo se attachea el skybox a la cámera? Para rootNode es
rootNode.attachChild(skyBox);
pero con la cámara la siguiente sentencia da error:
cam.attachChild(skyBox);
la cámara no tiene la función de attachear. ¿Cómo se hace?

Pablo, you don’t attach the Skybox direct to cam, try this:

[java] CameraNode camNode = new CameraNode(“camNode”, cam);

camNode.attachChild(sb);

rootNode.attachChild(camNode);[/java]

(where sb is your SkyBox)

1 Like

Trovolone :

Thank you!

You did exactly what i was wondering,

However, cam y camNode doesn’t have the same methods. And even I made all de camera movements work propertly I could’t make the rotation.



How I can do with a Text3D, so it is always in a readable position (perpendicular to the direction of the camera) but the location is always attached to objects?

rotation: the same as that of the camera

location: the same as that of other object

Need to be in the space, not on screen, so there is occlusion (and no happen what the http://hub.jmonkeyengine.org/groups/graphics/forum/topic/oclusion-of-awttext/)

Pablo, I started with JMonkey in this year, so I am not a expert. I had your answer because I had to do exactly what you was needing.

So, if what you need now is the camera rotate around a object I have this too :). I used with base the example of this page http://hub.jmonkeyengine.org/groups/user-code-projects/forum/topic/rotation-camera/.

But it isn’t what you want, sorry but I really don’t know what is “readable” or “occlusion”. You need more specialized help.