Re: OrientedShape3D not working
Posted by philjord on Oct 20, 2023; 9:57pm
URL: https://forum.jogamp.org/OrientedShape3D-not-working-tp4042902p4043086.html
Basti,
You beat me to it, I was just typing out the same commnet.
Mode in the constructor only accepts a single value
ROTATE_ABOUT_AXIS, ROTATE_ABOUT_POINT, or ROTATE_NONE
which is not a bitwise flag.
The capability bit settings should be sent to setCapabilities
So this
int mode = OrientedShape3D.ROTATE_ABOUT_POINT
| OrientedShape3D.ALLOW_MODE_WRITE | OrientedShape3D.ALLOW_MODE_READ
| OrientedShape3D.ALLOW_MODE_WRITE | OrientedShape3D.ALLOW_MODE_READ
| OrientedShape3D.ALLOW_POINT_WRITE | OrientedShape3D.ALLOW_POINT_READ
| OrientedShape3D.ALLOW_AXIS_WRITE | OrientedShape3D.ALLOW_AXIS_READ;
//int mode = 0;
Appearance appBlue = new Appearance();
this.shape = new OrientedShape3D(text3D, appBlue, mode, new Point3f(0.0f,0.0f,0.0f));
should be
int mode = OrientedShape3D.ROTATE_ABOUT_POINT );
Appearance appBlue = new Appearance();
this.shape = new OrientedShape3D(text3D, appBlue, mode, new Point3f(0.0f,0.0f,0.0f));
/**
* Sets the specified capability bit. Note that only one capability bit
* may be set per method invocation--capability bits cannot be ORed
* together.
* @param bit the bit to set
* @exception RestrictedAccessException if this object is part of live
* or compiled scene graph
*/
this.shape.setCapability( OrientedShape3D.ALLOW_MODE_WRITE);
this.shape.setCapability( OrientedShape3D.ALLOW_MODE_READ);
this.shape.setCapability( OrientedShape3D.ALLOW_MODE_WRITE );
this.shape.setCapability( OrientedShape3D.ALLOW_MODE_READ);
this.shape.setCapability( OrientedShape3D.ALLOW_POINT_WRITE );
this.shape.setCapability( OrientedShape3D.ALLOW_POINT_READ);
this.shape.setCapability( OrientedShape3D.ALLOW_AXIS_WRITE );
this.shape.setCapability( OrientedShape3D.ALLOW_AXIS_READ);
Which is annoyingly long winded, I've never noticed the single bit per call requirement.