Hello,

I'm creating an application where I try to load a .wrl file. The file loads
in but I don't see him on the screen, after I zoom out for a very long time
the file comes visible. I know that the viewpoint's not set well but I don't
know how to fix it.

Here is the code that I'm using to set my viewpoint:

VrmlScene scene;
VrmlLoader loader = new VrmlLoader();
scene = (VrmlScene) loader.load(url);
Vector3d offset = new Vector3d();

Transform3D objTrans = new Transform3D();
BranchGroup sceneGroup = scene.getSceneGroup();
sceneGroup.setCapability(BranchGroup.ALLOW_BOUNDS_READ);
sceneGroup.setCapability(BranchGroup.ALLOW_BOUNDS_WRITE);

// create the setup viewpoint
BoundingSphere sceneBounds = new BoundingSphere(sceneGroup.getBounds());

double radius = sceneBounds.getRadius();

Point3d center = new Point3d();
sceneBounds.getCenter(center);

offset.x = center.x;
offset.y = center.y;
offset.z = center.z;

objTrans.set(radius, offset);
//viewTransformGroup is the transformGroup to set the viewplatform
viewTransformGroup.setTransform(objTrans);

Can anyone help me out, please?

---------------------------------------------------------------------
Jochen Vande Walle
Software Developer

QMatics
Bruggesteenweg 112
8830 Hooglede - België
---------------------------------------------------------------------
Tel.    +32 51 272 400
Fax.   +32 51 272 401
---------------------------------------------------------------------
mailto:[EMAIL PROTECTED]

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to