here is the code to draw a curve:
Shape3D createcurve(){
int steps = 720;
float x = 0.1f;
Point3f[] coords = new Point3f[steps];
for (int i = 0; i < coords.length; i++) {
coords[i] = new Point3f(x,(float)Math.pow(2,x),0.0f);
x += 0.1f;
}
int[] strip = {steps};
LineStripArray lsa = new LineStripArray(steps, LineStripArray.COORDINATES, strip);
lsa.setCoordinates(0, coords);
Appearance app = new Appearance();
app.setLineAttributes(new LineAttributes(1.5f, LineAttributes.PATTERN_SOLID, true));
return new Shape3D(lsa, app);
}
this curve would be added to the BranchGroup, and show.
but I want to draw it dynamically(not show all the curve in one time)
I don't know how to use the Behavior to do this
PLS help me to do it.
THX