Move camera vs object with mouse... Recommended method?
Move camera vs object with mouse... Recommended method?
I want my scene to be fixed with respect to the SkyBox so that navigating simply moves the camera, and the scene will appear fixed to the ground. What is the recommended way of doing this? I don't want to mess with the core code if there's already a setting for this. I suppose I could take over the mouse events and calculate the transforms myself, but I'm wondering if this is already supported in the Viewer somewhere, maybe I shouldn't reinvent it.
Re: Move camera vs object with mouse... Recommended method?
Try the tool de.jreality.tool.tools.ShipNavigationTool. I'm not completely familiar with it, but if you add to a node "one above" the node containing the camera, it responds to the arrow keys to fly towards, away, to the left, or to the right.
There is also a class called FlyTool which responds only to up arrow and down arrow.
If these tools don't do what you want, at least they may provide you with a template for writing your own camera fly tool.
There is also a class called FlyTool which responds only to up arrow and down arrow.
If these tools don't do what you want, at least they may provide you with a template for writing your own camera fly tool.
jReality core developer
Re: Move camera vs object with mouse... Recommended method?
tried this
and this
The background stays stationary while the foreground moves in either case. I'm just going to try to disable the mouse or use a different viewer. I've tried doing this:
and commenting out lines with addVRSupport() and ContentTools(). I can comment them out to get the mouse to stop moving, but then it won't let me browse the tree. I suppose I need to look that up, but I'll probably just use the opengl Viewer class directly and give up that added functionality.
I need to move on & get a paper out this week so it may be awhile before I spend more time on this problem unless the solution is trivial. I'll be using the ...jogl.Viewer directly instead without the tree.
Thanks.
_-T
Code: Select all
RoboticSystem scene = new RoboticSystem();
final Viewer viewer = JRViewer.display(scene);
viewer.getSceneRoot().addTool(new ShipNavigationTool());
Code: Select all
RoboticSystem scene = new RoboticSystem();
final Viewer viewer = JRViewer.display(scene);
viewer.getSceneRoot().addTool(new FlyTool());
Code: Select all
JRViewer v = new JRViewer();
v.addBasicUI();
v.addVRSupport();
v.addContentSupport(ContentType.TerrainAligned);
v.registerPlugin(new ContentAppearance());
v.registerPlugin(new ContentTools());
v.setContent(SceneGraphNode contentNode);
v.startup();
I need to move on & get a paper out this week so it may be awhile before I spend more time on this problem unless the solution is trivial. I'll be using the ...jogl.Viewer directly instead without the tree.
Thanks.
_-T