How do I setup the X3D for Writing XML with JAXB after using XJC

BlakeF

New Member
Ok, I have the x3d xsd and used JAXB xjc to create 200+ java files that give me everything I need to create the X3D format. I have the XML writer working and will output to a file the X3D that I create. The problem is I am not sure HOW to create it. More specific, I made a variable:\[code\]X3D x3d = new X3D();\[/code\]I then set the following:\[code\] x3d.setHead( null ); x3d.setVersion("1.0"); x3d.setScene(sc); x3d.setProfile( ProfileNames.FULL );\[/code\]I ran the program and verified that it did write the XML file. Then I created a Scene variable and (here is why I can't post everything) in another class, I have a file that is supposed to create a Transform variable for itself and basically make a box in the transform. Here is a snippet of what I am trying to do:\[code\]Transform room = new Transform();Box floor = new Box();Box north = new Box();Box south = new Box();Box east = new Box();Box west = new Box();double loc_x = origin.x;double loc_y = origin.y;double loc_z = origin.z;double size_x = width;double size_y = height;double size_z = length;if ( angle > 0.0001 ) { size_x = height; size_y = width; size_z = length;}double center_x = loc_x + ( size_x / 2);double center_y = loc_y + ( size_y / 2);double center_z = loc_z + ( size_z / 2);room.setCenter( String.format("%f %f %f", center_x, center_y, center_z ) );room.setBboxCenter( String.format("%f %f %f", center_x, center_y, center_z ) );room.setScale( String.format("1 1 1" ) );room.setTranslation( String.format("%f %f %f", width, length, height ) );room.setRotation( String.format("0 0 0 0" ) );room.setContainerField( floor.getContainerField() );dbug.myMessage( "WalkWay", "getX3Dmodel", "Set transform %s", room.getContainerField().toString() );return room;\[/code\]Essentially, I need to take the dimensions here and create a "room". At the moment, I am only adding in the "floor" just to have something. Anyway, when I do a printout I do not get what I thought I might. All it says that the ContainerField is "geometry". Perhaps that is normal. And then when I return this transform back I don't know how to add it to the Scene variable so that I can add that to the X3D variable for output.What I could really use is an example of how to use these new classes to be able to make the settings I need and output the right stuff. Anyone have an example or know where one is that is in java (like the java from the xjc) not just in XML because I know what it is supposed to look like after it marshalls the file. But I don't know how the code is to look to setup the variables to marshall correctly.
 
Back
Top