Is there a way to get the bounds of an Object3D in world space? I need to draw a rectangle around an object in my gui. It's supposed to simulate a target tracking system. But I can't seem to find and bounds information. Java 3D had a getBoundingBox() method but I can't find a similar method in jpct.
This one may help:
http://www.jpct.net/doc/com/threed/jpct/Mesh.html#getBoundingBox()
Edit: I've no idea, why the forum software can't create a link out of this...anyway...
Quote from: "EgonOlsen"This one may help:
http://www.jpct.net/doc/com/threed/jpct/Mesh.html#getBoundingBox()
Edit: I've no idea, why the forum software can't create a link out of this...anyway...
http://www.jpct.net/doc/com/threed/jpct/Mesh.html#getBoundingBox()
put them without the //
Maybe the default options of the forums is set to avoid this kind of scripts.
getBoundingBox() returns the coordinates of the Object3D in object space. How could I translate this into screen coordinates :?: Would I need to first convert them into world coordinates :?: :?:
Yes. Transform them into world space by making SimpleVectros from it and apply the Object3D's world transformation matrix to those. Then project them into 2D using the methods in Interact2D.
EgonOlsen,
Thanks for the help, but I'm still stuck on the conversion from 3D to 2D coordinates. The Interact2D.projectCenter3D2D() methods only convert the center point of an Object3D into screen coordinates. I don't see a way of converting an arbitrary SimpleVector.
Maybe you are using an older version of jPCT!? The latest has a method in Interact2D that takes and projects any SimpleVector instead of just an object's center.
Yes I was using an older version :oops: Thanks for the help!