when does rotate tool activate?

Have jReality programming problems or questions? Post them here.
Post Reply
fsmmu
Posts: 2
Joined: Thu 10. Feb 2011, 01:47

when does rotate tool activate?

Post by fsmmu » Thu 10. Feb 2011, 01:56

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

Andre
Posts: 226
Joined: Fri 18. Sep 2009, 11:30

Re: when does rotate tool activate?

Post by Andre » Thu 10. Feb 2011, 02:17

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:

Code: Select all

JRViewer v = new JRViewer();
v.registerSOMEotherPLUGINS...
[b]v.registerPlugin(new ContentTools());[/b]
v.setContent(eg. ICOSAHEDRON);
v.startup();
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

User avatar
steffen
Posts: 186
Joined: Fri 16. Jun 2006, 13:30
Location: TU Berlin
Contact:

Re: when does rotate tool activate?

Post by steffen » Thu 10. Feb 2011, 05:00

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?
You need to set the emptyPickPath on the toolsystem. Tools along this path are triggered when a user clicks on the background.

fsmmu
Posts: 2
Joined: Thu 10. Feb 2011, 01:47

Re: when does rotate tool activate?

Post by fsmmu » Thu 10. Feb 2011, 12:22

steffen wrote:You need to set the emptyPickPath on the toolsystem. Tools along this path are triggered when a user clicks on the background.
It was that simple :)

Thank you

goose12
Posts: 11
Joined: Sun 24. Jul 2011, 03:08

Re: when does rotate tool activate?

Post by goose12 » Sat 30. Jul 2011, 05:29

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());

User avatar
gunn
Posts: 323
Joined: Thu 14. Dec 2006, 09:56
Location: TU Berlin
Contact:

Re: when does rotate tool activate?

Post by gunn » Wed 3. Aug 2011, 21:19

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.
jReality core developer

Post Reply