Hello,
I'm very new to jreality and I'm trying to create the viewer component from scratch (not using JRViewer.display()).
When I create a scene (e.g. just an icosahedron) and view it with JRViewer the rotate tool activates when clicking anywhere in the viewing window. I can't seem to get this behaviour when I create the whole scene graph from scratch. The tool requires me to click on the icosahedron for it to activate. I wish to be able to rotate the whole scene without having to click on a particular object.
How does JRViewer achieve this?
Many thanks,
Danny
when does rotate tool activate?
Re: when does rotate tool activate?
Hi fsmmu,
welcome to jReality. As far as I understand your question, you simply forgot to add the tool-plugin to the viewer.
Probably this should work:
Further I can recommend you the tutorial about setting up a JRviewerVR. If you don't need VR-Support, then forget about the VRpart, but the rest of the example is a easy way to get a nice Viewer for JReality.
http://www3.math.tu-berlin.de/jreality/ ... ctionality
BTW I can really recommend the developer tutorials:
http://www3.math.tu-berlin.de/jreality/ ... r_Tutorial
best
Andre
welcome to jReality. As far as I understand your question, you simply forgot to add the tool-plugin to the viewer.
Probably this should work:
Code: Select all
JRViewer v = new JRViewer();
v.registerSOMEotherPLUGINS...
[b]v.registerPlugin(new ContentTools());[/b]
v.setContent(eg. ICOSAHEDRON);
v.startup();
http://www3.math.tu-berlin.de/jreality/ ... ctionality
BTW I can really recommend the developer tutorials:
http://www3.math.tu-berlin.de/jreality/ ... r_Tutorial
best
Andre
Re: when does rotate tool activate?
You need to set the emptyPickPath on the toolsystem. Tools along this path are triggered when a user clicks on the background.The tool requires me to click on the icosahedron for it to activate. I wish to be able to rotate the whole scene without having to click on a particular object.
How does JRViewer achieve this?
Re: when does rotate tool activate?
It was that simple :)steffen wrote:You need to set the emptyPickPath on the toolsystem. Tools along this path are triggered when a user clicks on the background.
Thank you
Re: when does rotate tool activate?
Could you post a snippet of the code that you used... I tried the code below, but I am pretty sure I'm sending it the wrong path. Thanks in advance.
Code: Select all
ToolSystem.getToolSystemForViewer(v.getViewer()).setEmptyPickPath(v.getViewer().getCameraPath());
Re: when does rotate tool activate?
There is no right or wrong path; the deciding factor is whether you have put the tools you want to be activated on this path. Since you are passing in the camera path of the viewer, this would mean you have added the tools you want to be activated, somewhere on this path, for example, in the component containing the camera. If that's not the case, then the tools will not be activated when the background is clicked on.
This would probably be a good topic for a tutorial. Thanks for bringing it to our attention.
This would probably be a good topic for a tutorial. Thanks for bringing it to our attention.
jReality core developer