Hi;
I am trying to load an object from VRML into my Java3D scene. The object
has a bounding sphere with:
radius = r =112.05467415507485
center = (x,y,z) = (100.0, 50.0, 0.0)
Now what I am trying to do is finding a good vantage point for this
object. However, what I am getting is an empty screen. What is the
problem?
Any help will be appreciated.
Regards
Murat Tanyer
My scenegraph is something like below:
VirtUniv
|
Locale
/ \
BranchGroup (view_Group)
|
TransformGroup (view_tg)
|
ViewPlaform (camera)
|
View (view)
|
canvas (canvas)
VirtualUniverse universe = new VirtualUniverse();
Locale locale = new Locale(universe);
BranchGroup view_group = new BranchGroup();
ViewPlatform camera = new ViewPlatform();
//Translate view platform to the object's bounding sphere center than
move a little back
Transform3D vp_trans = new Transform3D();
vp_trans.set( new Vector3d( x, y, z + 1.40 * radius / tan ( Math.PI /
6.0 ));
TransformGroup view_tg = new TransformGroup(vp_trans);
view_tg.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
view_tg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
view_tg.setCapability(TransformGroup.ALLOW_LOCAL_TO_VWORLD_READ);
view_tg.addChild(camera);
view_group.addChild(view_tg);
BoundingSphere light_bounds = new BoundingSphere(center, radius);
DirectionalLight headlight = new DirectionalLight();
headlight.setColor(white);
headlight.setInfluencingBounds(light_bounds);
view_group.addChild(headlight);
PhysicalBody body = new PhysicalBody();
PhysicalEnvironment env = new PhysicalEnvironment();
View view = new View();
view.setBackClipDistance(radiubody);
view.setPhysicalEnvironment(env);
view.addCanvas3D(canvas);
view.attachViewPlatform(camera);
// Add view group to thes);
view.setPhysicalBody( locale
locale.addBranchGraph(view_group);
===========================================================================
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".