How would I use a LineArray to display a parabola (tracing the path of a projectile)
float hAngle = unitAngle;
float velocity = 5;
Point3f[] pointz = new Point3f[] {
new Point3f(unitLoc.x, unitLoc.y, unitLoc.z),
new Point3f(unitLoc.x + velocity*(float)Math.sin(hAngle), unitLoc.y + velocity*1 +.5f*-9.8f*1, unitLoc.z+ velocity*(float)Math.cos(hAngle)),
new Point3f(unitLoc.x + (float)Math.sin(hAngle), unitLoc.y + velocity*2 +.5f*-9.8f*4, unitLoc.z+ (float)Math.cos(hAngle)),
new Point3f(unitLoc.x + (float)Math.sin(hAngle), unitLoc.y + velocity*3 +.5f*-9.8f*9, unitLoc.z+ (float)Math.cos(hAngle)),
new Point3f(unitLoc.x +(float)Math.sin(hAngle), unitLoc.y + velocity*4 +.5f*-9.8f*16, unitLoc.z+ (float)Math.cos(hAngle)),
};
LineArray path = new LineArray(pointz.length, LineArray.COORDINATES);
path.setCoordinates(0, pointz);
Shape3D parabola = new Shape3D(path, new Appearance());
scene.addChild(parabola);
v.renderOnce();
try{
wait(1000);
} catch (InterruptedException ie) {}
scene.removeChild(parabola);
v.renderOnce();
I tried using this code, but nothing is rendered… any ideas?