Skip to main content

[Xj3D API problem]How to load Background by using X3DLoader

2 replies [Last post]
jiahan
Offline
Joined: 2005-01-21

I use X3Dloader to import x3d scene to construct Java3D scene graph from x3dv file~
And this x3d scene has Background node, which to pasted full image around the 3D world.
But I can't see any background in Java3D world, when I use X3DLoader to import that X3D scene.
And then I use the browser(in Java3D render) bundled with Xj3D API, to view the X3D file....I can see the background.

I think the X3DLoader is already load the background node into java3D scene, but the background node's shape is black, and no image pasted on these shape.
So how to use X3DLoader to load X3D scene's background correctly??
Does everyone familiar with Xj3D API can help me.
thanks~

My JDK is 1.5, My Java3D API is 1.3.1, Xj3D API is M10

x3dv code:
---------------------------------------------------------
Background {
backUrl [ "ocean_3_back.jpg" ]
bottomUrl [ "ocean_3_bottom.jpg" ]
frontUrl [ "ocean_3_front.jpg" ]
groundAngle [ 0.1, 1.309, 1.571 ]
groundColor [ 0 0 0, 0 0.1 0.3, 0 0.2 0.5, 0 0.3 0.8 ]
leftUrl [ "ocean_3_left.jpg" ]
rightUrl [ "ocean_3_right.jpg" ]
skyAngle [ 0.1, 0.15, 1.309, 1.571 ]
skyColor [ 0.4 0.4 0.1, 0.4 0.4 0.1, 0 0.1 0.3, 0 0.2 0.6, 0.8 0.8 0.8 ]
topUrl [ "ocean_3_top.jpg" ]
}
--------------------------------------------------------

Java code
--------------------------------------------------------
BranchGroup worldRoot = new BranchGroup();
int flag = X3DLoader.LOAD_ALL;
X3DLoader loader = new X3DLoader(flag);
Scene scene = null;

scene = loader.load("x3dv/background/background.x3dv");
worldRoot.addChild(scene.getSceneGroup());
worldRoot.compile();
universe.addBranchGraph(worldRoot);
---------------------------------------------------------

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Justin Couch

java3d-interest@javadesktop.org wrote:

> I use X3Dloader to import x3d scene to construct Java3D scene graph from x3dv file~

First note: THis is not a Java3D-specific problem. Please don't annoy
the people on this list by asking about problems with a non-Java3D set
of libraries. The appropriate place to ask questions about it is on the
Web3D consortium's source code mailing list. You can find sign up
details for it here:

http://www.web3d.org/x3d/workgroups/source.html

> I think the X3DLoader is already load the background node into java3D scene, but the background node's shape is black, and no image pasted on these shape.
> So how to use X3DLoader to load X3D scene's background correctly??

I can't say that we've tested the Background node handling under loader
conditions. The code looks like it will work, but that's not a good
indicator of actual success :) Once I get bugzilla back up and working,
I'll add your test case as a bug.

--
Justin Couch http://www.vlc.com.au/~justin/
Java Architect & Bit Twiddler http://www.yumetech.com/
Author, Java 3D FAQ Maintainer http://www.j3d.org/
-------------------------------------------------------------------
Programming is essentially a markup language surrounding
mathematical formulae and thus, should not be patentable.
-------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

jiahan
Offline
Joined: 2005-01-21

Thank your comment,I will post this question on Web3D forum.