|
Hi,
Thank you all for your help.
It seems to work but my ModelClip does not fit my
objects extremities. it start after the highest point and stop before the
last one.
If your equation is correct (and I know it is), the
problem should comes from the extremum points determination, but I can not find
the mistake.
Here is the code I use:
Hashtable objs= new Hashtable();
objs= scene.getNamedObjects();
Set keys = objs.keySet(); Iterator ite = keys.iterator(); extremumPointTop=0; extremumPointBottom=0; while (ite.hasNext()){ Object obj3d = ite.next(); Shape3D node = (Shape3D) objs.get(obj3d);
//search the 2 extremum points for each object
javax.media.j3d.BoundingBox bbox = new
BoundingBox(node.getBounds());
Point3d posUpper = new Point3d(); bbox.getUpper(posUpper); Point3d posLower = new Point3d(); bbox.getLower(posLower);
//get the x y and z values for each
point
double[] tupleUpper=new double[3]; posUpper.get(tupleUpper); double[] tupleLower=new double[3]; posLower.get(tupleLower);
//search the 2 extremum y values for the entire
scene
if (tupleUpper[1]>extremumPointTop) extremumPointTop = tupleUpper[1]; if(tupleLower[1]<extremumPointBottom) extremumPointBottom = tupleLower[1]; }
System.out.println("extremum:
"+extremumPointTop+" "+extremumPointBottom);
Thanks for your help in advance.
|
- [JAVA3D] fit ModelClip Olivier Tassy
- Re: [JAVA3D] fit ModelClip Renoir Sewjee
- Re: [JAVA3D] fit ModelClip Olivier Tassy
- Re: [JAVA3D] fit ModelClip Dipl. Ing. Paul Szawlowski
- Re: [JAVA3D] fit ModelClip Ingo Brunberg
