I want draw a line between to specify point in java 3d.
how can i do it?
for example for draw a cube we write colorcube.
please help me.
Use the LineArray class. Create an object for it with two vertices( wherever you want them to be) and add this to a Shape3D object.i.e. new Shape3D(lineArr).
For line array:
LineArray lineArr=new LineArray(2,LineArray.COORDINATES);
then:
lineArr.setCoordinate(0,new Point3f());...
do the same for the other vertex.
Then add the shape3D object to a scene graph or Branchgroup.
That should do the trick.
This post might help you: How to draw lines with Java3D [java-tips.org]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With