Java Reference
In-Depth Information
Appendix F
Knob Class for
Web-Based 3D
f.1 ImportInG lIbrarIes
import java.lang.Math.*;
import javax.vecmath.*;
import com.sun.j3d.utils.picking.PickTool;
f.2 defInInG class for control knob
public class Knob3D extends TransformGroup
public Knob3D(float radius, float length, int segmentCount, Appearance look, Texture texture)
// The direction of the ray from the knob's center
float xDirection, yDirection;
float xKnob, yKnob;
Appearance frontfacelook = new Appearance();
// The z coordinates for the knob's faces
float frontZ = 0.5f * length;
float rearZ = -0.5f * length;
int knobFaceVertexCount;
// #(vertices) per knob face
int knobFaceTotalVertexCount;
// total #(vertices) in all teeth
Search WWH ::

Custom Search