//
// written by Aurelien on 2012-02-15
//

[[FrontPage]]
Up:[[Tutorial]]

----
#contents

This report explains how to extract .x3d objects from a .wrl room file.

There are many ways to do this, and the one described here is probably not the best, so please feel free to explore and test other methods.

The .wrl file was provided with separate .jpg texture files.


We will use Blender as editing tool. Blender is a freeware easy to install and with a lot of possibilities, but it also has limitations in its current state.


** VISUALIZING A .WRL FILE [#i5272e12]

One of the limitations of Blender is that it is quite difficult to visualize an object as it is supposed to appear. The 3d view window does not display lighting or textures, only the shape of the objects.

To see the final aspect of an object in Blender, one needs to put a camera in front of it, create some lighting, and then take a picture from that camera.


So it is more convenient to visualize a .wrl or .x3d file with another tool.

For example, the navigator plugin called Cosmo Player lets you see the result of a .wrl file and navigate it.


** OPENING A .WRL FILE WITH BLENDER [#d465dd94]

Select File > Import > X3D Extensible 3d (.x3d/.wrl) then choose the file you want to open.

You can also Import a .x3d file, but for some reason it seems that imported .x3d files do not have textures, so you will have to put textures manually.


** MOVING IN BLENDER [#f288d0bd]

In the 3d view window of Blender, you can move with the numerical pad.

The keys 2, 4, 6, 8 orientate your view in the corresponding direction.

By pressing Shift in addition to one of these keys, you can move in the corresponding direction.


** SELECTING OBJECTS IN BLENDER [#x9e2a723]

In the 3d view window of Blender, you can select an object by right-clicking on it. Selected objects appear with an orange outline.

To select multiple objects, right-click on the first and Shift+right-click on the others.


** GROUPING OBJECTS IN BLENDER [#k9bdda4c]

The first step will be grouping the objects : sometimes, one object that you want to extract is composed by more than one objects in the original world file (for example, a table can be composed of a main plank and 4 legs).

To do so, select all the desired objects at the same time.

Then, select Object > Group > Create new group.

A name box should appear on the left : change the group name to your liking, then confirm by clicking outside of the name box.

All the grouped objects should appear with a green outline.


To remove an object from a group, select the object, then select Object > Group > Remove Selected from Active Group.


To add objects to a previously existing group, select all the objects you want to add, then shift+right-click to select any object from the desired group.
Select Object > Group > Add Selected to Active Group.


** SAVING A BLENDER FILE [#ge1df2c0]

Once you're finished grouping your objects, save the file in Blender format by selecting File > Save.

You should also save your file frequently if you do lots of changes.


** EXPORTING AN OBJECT FROM BLENDER TO AN .X3D FILE [#m48ed11a]

Open a new file (File > New).

Delete the cube, camera and source of light (small dot) by right-clicking on them, then pressing Delete.

Select File > Append, go to the directory of your saved Blender file (.blender), select your file, then select Group, then select the group you want to export.

If you look around in the 3d view window you will see that the group appeared.
Then you can export it by selecting File > Export > X3D Extensible 3d (.x3d).


This way you can export all your objects from the world file.



** MORE ABOUT BLENDER [#g56176ba]

http://wiki.blender.org/



** CONVERTING AN .X3D OBJECT FROM BLENDER TO SIGVERSE FORMAT [#q6fe317b]

SIGVerse uses a specific and obscure format that does not accept all forms of otherwise valid .wrl and .x3d files.

In order to convert the .x3d file from Blender to SIGVerse format, I made a python script, called "x3dBlenderToSIGVerse2.py". You can find it in the downloads of this page.

To use it, run it in IDLE (python IDE), then type the command line :
copyPart("complete path of your file, including extension")


This should create another .x3d file compatible with SIGVerse, and an entity file linking to that new .x3d file.


** FINALLY [#efb6ad63]

Do not forget to add the textures to SIGViewer or your objects will appear totally white.

#counter

Front page   Edit Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes