Dear All,
I am looking for math formulae (or Java code) that could help me draw a cylinder between 2 spheres.
I am using Java to create a WRL file. The world is composed of several spheres (known x,y,z locations). I would like to draw cylinders between spheres, but I am struggling with the VRML rotation function.
So I would need a function that returns:
translation Ax Ay Az
rotation Bx By Bz Th
given 2 locations (x1,y1,z1) (x2,y2,z2)
Thanks,
Olivier
==========================
=
#VRML V2.0 utf8
Group {
children [
Transform {
translation 1 2 3
children Shape {
appearance DEF xapp Appearance {
material Material { }
}
geometry Sphere { radius 0.2 }
}
}
Transform {
translation 3 2 1
children Shape {
appearance USE xapp
geometry Sphere { radius 0.2 }
}
}
Transform {
translation 1 2 3
rotation 1 0 0 1.57
children Shape {
appearance USE xapp
geometry Cylinder {
radius 0.1
height 4
}
}
}
]
}
Start Free Trial