Java Reference
In-Depth Information
new Point3f(0.92f*radius, 0.06f*radius, 0.52f*length),
// bottom face
new Point3f(0.92f*radius, -0.06f*radius, 0.52f*length),
new Point3f(0.92f*radius, -0.06f*radius, -0.52f*length),
new Point3f(1.0f*radius, -0.06f*radius, -0.52f*length),
new Point3f(1.0f*radius, -0.06f*radius, 0.52f*length),
};
Vector3f[] normals =
{
new Vector3f( 0.0f, 0.0f, 1.0f),
// front face
new Vector3f( 1.0f, 0.0f, 0.0f),
// right face
new Vector3f( 0.0f, 1.0f, 0.0f),
// top face
new Vector3f( 0.0f, -1.0f, 0.0f),
// bottom face
};
int i;
QuadArray mark = new QuadArray(20, QuadArray.COORDINATES|QuadArray.NORMALS
|QuadArray.TEXTURE_COORDINATE_2);
for (i = 0; i < 16; i++)
{
mark.setCoordinate(i, verts[i]);
}
for (i = 0; i < 16; i++)
{
mark.setNormal(i, normals[i/4]);
}
mark.setCapability(Geometry.ALLOW_INTERSECT);
newShape = new Shape3D(mark, dotlook);
PickTool.setCapabilities(newShape, PickTool.INTERSECT_FULL);
this.addChild(newShape);
this.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
this.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
this.setCapability(TransformGroup.ALLOW_PICKABLE_READ);
this.setCapability(TransformGroup.ALLOW_PICKABLE_WRITE);
this.setCapability(TransformGroup.ENABLE_PICK_REPORTING);
}
f.3 functIon for chanGInG orIentatIon of knob
public void setRotationX(float angle)
{
Matrix3d rotMat = new Matrix3d();
Transform3D rt3d = new Transform3D();
this.getTransform(rt3d);
rt3d.getRotationScale(rotMat);
Search WWH ::




Custom Search