Hi everyone,
in first place good job, I really like your work on JReality.
I've been searching for a while in the forum but I haven't found nothing useful.
I want to get rid of the automatic rotation performed by the rotate tool when I mouse-drag an object in the viewer. I simply want to prevent JReality to further move an object dragged. I hope to have been clear.
Second (but less important):
- Is it possibile to get rid of the window labeled "Jreality" in the example SimpleViewer.java?
Bye,
Alfredo
Disabling automatic rotation
Re: Disabling automatic rotation
The code of SimpleViewer.java was a bad example. I changed the main method to reflect the different ways of using JRViewer.
The rotate tool is part of the "ContentUI" Plugin Set. There are numerous ways to disable or not install the rotate tool. here are just a few of those:
After startup call
Or don't use the ContentTools Plugin i.e. don't register the plugin before startup.
Or disable the rotation tool manually by clicking the button in the tool bar. The state of that button is stored in a preference file if you configure your application to do so.
Code: Select all
public static void main(String[] args) {
SceneGraphComponent world = new SceneGraphComponent();
world.setGeometry(Primitives.sharedIcosahedron);
View.setTitle("The Icosahedron");
View.setIcon(getIcon("color_swatch.png"));
JRViewer v = JRViewer.createJRViewer(world);
if (true) {
v.startup();
} else { // you could also do this but you loose the menu and tool bar?
v.startupLocal();
Viewer viewer = v.getViewer();
JFrame f = new JFrame();
f.getContentPane().add((Component)viewer.getViewingComponent());
f.setSize(512, 512);
f.validate();
f.setVisible(true);
}
}
After startup call
Code: Select all
v.startup();
c.getPlugin(ContentTools.class).setRotationEnabled(false);
Or disable the rotation tool manually by clicking the button in the tool bar. The state of that button is stored in a preference file if you configure your application to do so.
Re: Disabling automatic rotation
Hi, thanks for your reply.
Unfortunately, I think I've been unclear.
I want JReality RotateTool, because I want to be able to rotate an object, but I don't want that, when I rotate an object, sometimes it continues to rotate indefinitely! It stops only when I click on the object itself or in the outside world. Is this a bug of a correct behaviour?
I'm using Jreality under Mac Os 10.6.6, 64 bit.
Bye,
Alfredo
Unfortunately, I think I've been unclear.
I want JReality RotateTool, because I want to be able to rotate an object, but I don't want that, when I rotate an object, sometimes it continues to rotate indefinitely! It stops only when I click on the object itself or in the outside world. Is this a bug of a correct behaviour?
I'm using Jreality under Mac Os 10.6.6, 64 bit.
Bye,
Alfredo
Re: Disabling automatic rotation
Hi Alfredo,
this behavior is intended. There however is an inconvenient reaction in some cases, where
the rotate tool keeps spinning even if you just clicked. I consider this a bug. If you want to have a look into the source code of the RotateTool you find it here:
src-tool/de.jreality.tools.RotateTool
Stefan
this behavior is intended. There however is an inconvenient reaction in some cases, where
the rotate tool keeps spinning even if you just clicked. I consider this a bug. If you want to have a look into the source code of the RotateTool you find it here:
src-tool/de.jreality.tools.RotateTool
Stefan
Re: Disabling automatic rotation
The idea is that you can "push" the object into a rotation. If you want to disable that, use
Steffen.
Code: Select all
rotateTool.setAnimTimeMax(0);
Re: Disabling automatic rotation
Thanks guys,
browsing into the source code I've found nothing but the solution given by steffen and it works :)
Bye,
Alfredo
browsing into the source code I've found nothing but the solution given by steffen and it works :)
Bye,
Alfredo