[back to main page]

view3dscene (version 3.3.0)

Image from "view3dscene"
Image from "view3dscene"
Image from "view3dscene"
Image from "view3dscene"

view3dscene is a VRML / X3D browser, and a viewer for other 3D model formats.

  1. Features
  2. Downloading and installing
    1. Installing GNOME (and other freedesktops) integration
  3. Running
  4. Controlling program with keys & mouse
  5. Command-line options
    1. Capturing screenshots and movies of 3D scenes and animations
    2. Other options
  6. A few words about flat/smooth shading
  7. Notes about ray-tracer
  8. Requirements
  9. Freshmeat entry

1. Features

Supported file formats:

Among many features are:


2. Downloading and installing

Here are archived binaries of the program. No special installation is required, just unpack these archives and run the program. This documentation is also included in the archives (look in documentation subdirectory) for offline viewing.

Sources of this program are available from this page, in case you're interested.

Demo scenes: In Kambi VRML test suite you can find many simple VRML models that demonstrate what can be expressed in VRML 1.0, 2.0, X3D and what view3dscene can handle and display. These are not any big or beautiful scenes, you can find some (slightly) more impressive VRMLs in data files of my games The Castle, lets_take_a_walk, malfunction.

2.1. Installing GNOME (and other freedesktops) integration

To get simple integration with GNOME and other desktops following freedesktop.org specifications, you can optionally do somewhat more involved installation.

  1. First of all, you will need some scripts and data that currently is only in Subversion repository. Just run
    svn checkout https://vrmlengine.svn.sourceforge.net/svnroot/vrmlengine/trunk/view3dscene/desktop

  2. Make sure view3dscene binary is somewhere on the $PATH. You can symlink or just move the binary there.

  3. Then run

      make install
    
    inside downloaded desktop directory.
  4. You may need to logout and login again to your GNOME/desktop session for all programs to catch up (alternatively, you can do killall gnome-panel && killall nautilus but this is obviously somewhat brutal method).

That's it! You should now see view3dscene entry in your desktop menu (it's in the Graphics category), with a nice icon, and all known 3D model files will be recognized and double-clicking on them will launch view3dscene.

If you use GNOME file manager Nautilus there's one more cool thing you can do: use view3dscene to generate on-the-fly thumbnails of 3D models in the viewed directory. This is simple, assuming you already did previous steps (as it's required that view3dscene is on the $PATH and mime types are recognized) run

  make install_thumbnailer

inside the downloaded desktop directory. This will add the gconf keys to run thumbnailers on your 3D models. Enter some directory with VRML / X3D / other 3D files, and enjoy your thumbnails.

Beware that loading arbitrary 3D scene may take a lot of time, so using the thumbnailer may consume a lot of memory and CPU power. Although we try to be fast, and some things are specially optimized for screenshot, there are no guarantees. No engine can load arbitrary large 3D data without any noticeable resource use. Nautilus should automatically terminate thumbnailer that runs too long, so this is not critical problem. After all, reading large movies or images has similar problems, but it works quite Ok, right? (Actually, 3D data is much more difficult than reading just a few starting seconds of a movie or a simple 2D image...) That said, the author of this text is using view3dscene thumbnailer all the time, and it works flawlessly :) so give it a try!


3. Running

Simply run without any command-line parameters. Load your model file using "Open" menu item.

You can provide on the command-line file name to load. As usual, dash (-) means that standard input will be read (in this case the input must be in Inventor / VRML / X3D (classic) format).

Also read about view3dscene additional command-line options.


4. Controlling program with keys & mouse

Controls in Examine navigation mode :

Mouse:
Left mouse dragging rotate scene
Middle mouse dragging (or Left mouse + Shift) move scene horizontally/vertically
Right mouse dragging (or Left mouse + Ctrl) move scene closer/further
Keys:
Arrows / PageUp / PageDown rotate scene
Space stop rotating scene
Ctrl + Arrows / PageUp / PageDown move scene
+ / - scale scene
Home restore default rotation, translation and scale

Controls in Walk navigation mode :

Basic:
Up / Down move
Left / Right rotate
PageUp / PageDown raise/bow your head
Home restore head raise to initial position (neutralize any effect of PageUp / PageDown)
Insert / Delete fly up / down
Comma / Period strafe moving
A / Z jump / crouch (only when Gravity works in Walk mode)
Note: when mouse look is turned on then
  • Left / Right keys are responsible for strafe moving
  • Comma / Period keys are for rotations
Additional controls:
+ / - increase / decrease moving speed (has effect on keys Up / Down, Insert / Delete, Comma / Period)
Ctrl + Left / Right rotate slower (useful when you want to set up camera very precisely, e.g. to use this camera setting to render a scene image using ray-tracer)
Ctrl + PageUp / PageDown raise / bow your head slower
Left mouse click activate VRML/X3D sensor, to interact with VRML world
Right mouse click pick a point, selecting triangle and object

Now, there's a lot of keys that work independent of current navigation mode. But I will not list them all here. They all can be seen by looking at available menu items. Probably most useful keys (and menu items) are Ctrl+N (switch to next navigation mode), F1 (toggle status text visibility) and Escape (exit).


5. Command-line options

All options described below may be given in any order. They all are optional.

5.1. Capturing screenshots and movies of 3D scenes and animations

Command-line options:

  --screenshot  TIME  FILE-NAME
  --screenshot-range  TIME-BEGIN  TIME-STEP  FRAMES-COUNT  FILE-NAME

These options allow you to capture a screenshot of the loaded scene. They know about animations stored in 3D files, that's why they take parameters describing the animation time to capture. They are used to take screenshots in "batch mode". (In interactive mode, you can use comfortable menu items Display -> Screenshot....)

For a still 3D scene, you usually just want to use the simpler --screenshot option with TIME set to anything (like zero) and not worry about anything else.

For animations, more possibilities are available. You can capture any frames of the animation by using many --screenshot options. You can also capture a movie by --screenshot-range (as a series of images or, if ffmpeg is installed and available on $PATH, even directly to a single movie file). The biggest advantage of recording movie this way is that the movie is guaranteed to be captured with stable number of frames per second. This is different than using some independent programs to capture OpenGL output, like the fine Yukon, as real-time capture usually means that the program runs slower, and often you loose movie quality.

You most definitely want to pass 3D model file to load at command-line too, otherwise we'll just make a screenshot of the default empty (black) scene. So to take a simple screenshot of a scene, at it's default camera, just call

  view3dscene my_model.wrl --screenshot 0 output.png

The detailed specification how screenshot options work:

Examples:

Hints:

Generally, you can take a look at (complex) example how to make a screenshot from animation in screenshot_for_kambi_www/ directory.

5.2. Other options

--write-to-vrml

Option --write-to-vrml means "don't open any window, just convert the input model to VRML, write the result to the standard output and exit". This way you can use view3dscene to convert 3DS, MD3, Wavefront OBJ, Collada and GEO files to VRML, like
  view3dscene scene.3ds --write-to-vrml > scene.wrl ,
you can also use this to do some VRML file processing using options --scene-change-* described below.

--anti-alias AMOUNT

Use full-screen anti-aliasing. You can also configure it from the menu File -> Startup Preferences -> Anti aliasing. Using this command-line option is mainly useful together with --screenshot option.

Argument AMOUNT is an integer >= 0. Exact 0 means "no anti-aliasing", this is the default. Each successive integer generally makes method one step better. But also more demanding — program may run slower (if your graphic card cannot provide context with sufficient number of samples needed for multi-sampling). See Anti aliasing in interactive mode for the meaning of AMOUNT values. Currently, highest value is 4. So AMOUNT numbers above 4 are exactly the same as 4.

There is no guarantee what specific values of AMOUNT exactly mean, as this depends on your graphic card capabilities. The graphic cards themselves don't provide methods to reliably set some specific FSAA method (only hints, like glHint(GL_MULTISAMPLE_FILTER_HINT_NV, ...)) since the general idea is that better GPU models may provide the same or even better results using different methods. From your (user) point of view, you can test each method and just decide which looks best and isn't too slow on your 3D model and graphic card.

--scene-change-no-normals
--scene-change-no-solid-objects
--scene-change-no-convex-faces

Using one of these options changes the scene before it is displayed (or saved to VRML, if you used --write-to-vrml option). These options are useful when you suspect that some of the informations in scene file are incorrect.

These options change only the scene which filename was specified at command-line. Later scenes (that you open using "Open" menu item) are not affected by these options. Instead, you can use "Edit" menu commands to perform any of these scene changes at any time. Really, these command-line options are usable mostly when you're using parameter --write-to-vrml.

Below is the detailed description of what each scene change does. This is also a documentation what corresponding command in "Edit" menu of view3dscene does.

Example: I have here some model helicopter.wrl that looks incorrectly when it is displayed because all parts of model are marked as SOLID while they are not solid. So to view this model correctly I can use command
  view3dscene --scene-change-no-solid-objects helicopter.wrl
I can also correct this model once using command
  view3dscene --scene-change-no-solid-objects helicopter.wrl --write-to-vrml > helicopter-corrected.wrl.

--navigation Examine|Walk

Set initial navigation mode. Default is Examine. You can change navigation mode while the program is running using key Ctrl+N or appropriate menu item.

--camera-radius <float>

When you are walking in the scene with Walk navigation model with collision detection on, for the sake of collision detection "user" is treated as a sphere with non-zero radius. Default radius of this sphere is the average size of scene bounding box divided by 100. Using this command-line option, you can set the radius of this sphere to any value (greater than 0). This can be very useful, but be careful: too large radius will make moving (with collision detection turned on) impossible (because every possible move will produce a collision). Too little radius may produce precision-errors in depth-buffer (this can lead to some strange display artifacts).

--light-calculate on|off

Sets initial state of "Lighting calculate" option. If this is "on", lighting calculations are performed. Every vertex may have different color, depending on surface material, lights set in the scene, camera position etc. If this is "off" scene is rendered without lighting: every triangle has always the same, single color.

Default is true, which is usually much more reasonable. There is also a menu item "Lighting calculate" that you can use to change this setting while the program is running.

--detail-quadric-slices <integer>
--detail-quadric-stacks <integer>
--detail-rect-divisions <integer>

These options control triangulating. Two --detail-quadric-xxx options control triangulating of spheres, cones and cylinders: how many slices (like slices of a pizza) and how many stacks (like stacks of a tower) to create. The 3rd option, --detail-rect-divisions, says how we triangulate faces of cubes. It's best to test how your models look in wireframe mode to see how these options work.

Note that my programs do two different variants of triangulation, and they automatically decide which variant to use in each case:

  1. Normal triangulation, that is intended to improve the approximation of quadrics as triangle meshes. This is used for collision detection and for ray-tracer.
  2. The so-called over-triangulation (it's my term, used in various places in my code and documentation and printed messages), that is intended to improve the effect of Gouraud shading. This is used when rendering models with OpenGL.

    In this variant we do some more triangulation than in "normal" triangulation. E.g. in normal triangulation we don't divide cones and cylinders into stacks, and we don't divide cube faces (because this doesn't give any better approximation of an object). But when over-triangulating, we do such dividing, because it improves how objects look with OpenGL shading.

--renderer-optimization none|scene-as-a-whole|separate-shapes|separate-shapes-no-transform

Set rendering optimization. It's difficult to describe in short what each value means, you can just try them all. They all produce identical results, but some are slower and some are faster.

For more technical details see documentation of TGLRendererOptimization type in VRMLGLScene unit.

As usual all standard options understood by my OpenGL programs are also allowed. See also notes about command-line options understood by my programs.


6. A few words about flat/smooth shading

Using menu item View -> Smooth shading you can switch between using flat and smooth shading. Default is to use smooth shading.

Flat shading means that each triangle has only one normal vector and only one solid color. Smooth shading means that adjacent triangles with a similar plane can share the same normal vectors at their common edges. In effect shapes that are approximating some perfectly smooth surfaces (e.g. spheres) may be rendered better with smooth shading. Moreover smooth shading allows triangle to have different material properties at each vertex (e.g. one vertex is yellow, the other one is blue), you can see example of this in Kambi VRML test suite in file vrml_1/materials.wrl.

Group of planes are similar if angle between each pair of planes is smaller than creaseAngle value (of last seen ShapeHints in VRML 1.0, or of the given geometry node in VRML >= 2.0). For other 3D model formats we use default creaseAngle = 0.5 radians (a little less than 30 degrees).

Note: if VRML file already had some normal vectors recorded (in Normal nodes) then program will use them, in both flat and smooth shading. Usually it's not important but to be sure that proper normals are used you can use menu item "Edit -> Remove normals info from scene".


7. Notes about ray-tracer

Use menu item Display -> Raytrace! to render image using ray-tracing. I implemented two ray-tracing versions: classic (Whitted-style) and path tracing. view3dscene will ask you which algorithm to use, and with what parameters.

Rendered image will be successively displayed. You can press Escape to stop the process if it takes too long. After generating image program will wait for pressing Escape, you can also save generated image to file.

What to do to make this process less time-consuming? First of all, the simplest thing to do is to shrink the window. Second, the quality of octree has great influence on rendering time — you can try tightening it by KambiNavigationInfo.octreeVisibleTriangles inside VRML/X3D file (see octree properties extension).

More detailed description of how ray-tracer works is given in documentation of rayhunter.


8. Requirements

To play movies (in VRML MovieTexture nodes) and to record movies (by --screenshot-range option) you have to install ffmpeg and make sure it's available on $PATH.

Also convert program from ImageMagick package must be available on $PATH for some image formats to work.


9. Freshmeat entry

Here's a link to view3dscene entry on freshmeat. You can use this e.g. to subscribe to new releases, so that you will be automatically notified about new releases of view3dscene.