Open topic with navigation
1. 3D Models
3. Flow control and animations
6. Viewpoint and Navigation
7. Vizard IDE
The table on the 3D Models page lists all the formats that are supported.
If you are using 3dsmax then WorldViz highly recommends you use the OSG exporter for 3ds Max which is freely available on our downloads page. It will export models to Vizards native format, which supports more features than any other format. Choose between the text format (.osgt) or the binary format (.osgb). The binary format loads very quickly and embeds all texture data inside it. The exporter also has an option to compress textures, which further reduces the size and loading time of the binary file.
While Vizard has some facility for creating content (e.g., 2D & 3D text, primitives and shapes), most likely your project's completion will require you to provide your own content either by creating it using 3rd party software or by leveraging content created by others. The 3D Models page lists some sites where you can purchase and download free models.
3ds Max exports to Vizard's native OSG format and is the best modeler for Vizard. WorldViz uses 3ds Max internally for creating assets and supports the workflow through this software. Even if you're not creating content, it's useful for exporting models found online to the OSG format.
There are a number of other applications that export to Vizard compatible formats, some of the more commonly used are Google SketchUp and Blender. The following knowledge base article describes the SketchUp workflow:
All objects added to the scene have a remove command, which permanently deletes the object.
To remove all objects from a scene, you can use the following:
Load the model used to create the scene (e.g. room, house, city etc.) into Inspector, right click on the location and copy the coordinates.
The following example will rotate a model 45 degrees along the parent's y axis:
The following example will rotate a model 45 degrees along its local y axis:
If you need more advanced control you could use the Transform class. Here's a simple example:
As soon as any image is loaded into Vizard mipmaps are automatically generated.
If you are using 3ds Max and exporting to the OSG format you can specify LODs. From 3ds Max, in the create tab of the Command panel, go to helpers, then select OpenSceneGraph from the dropdown list. You should see an option along the lines of "OSG LOD" where you can set the LODs. When you export the model make sure 'Helpers' is one of the options checked.
The Performance page explains how to read Vizard's render stats and determine the cause of a frame rate drop. The Optimization page describes how to reduce the drawables, polygons, and textures of a model to improve performance.
A copy will have the appearance of the original object when it was created. Any future changes to the original object's appearance will not affect the copy. There is a unique instance for each model but only one file needs to be loaded thereby reducing the load time.
If your script does not require a unique instance for each model, then you can use the clone command. Clones share the appearance of all the other clones. Changing the appearance of any one clone will change the appearance of all the others (although all their position, orientation, and scale transforms will be independent). In addition to reducing load time, memory is conserved as there is only one instance in memory for all the clones.
Vizard allows you to create basic geometric objects (e.g. points, lines, triangles) on-the-fly. These objects are defined by creating vertices and then connecting those vertices with lines or surfaces. After an object is created it's vertices can be manipulated.
The vizshape library allows you to add more complex shapes (e.g. cubes, cylinders, cones). Unlike the on-the-fly objects you create with basic primitives you will not be able to access or manipulate individual vertices.
Once you've added either an on-the-fly or vizshape object, you can treat it as you would any other 3D object (e.g. set it's position, color, visibility etc.)
Yes, see the Transparency page for a discussion on this topic and to learn workarounds for issues that can arise when transparent objects are combined in the same scene.
Vizard supports the Cal3D avatar format. The Cal3D exporter for Max is available from the WorldViz download page. The Cal3D tutorial describes how to use the exporter.
Unless you've purchased the Complete Character set with the Max files you won't be able to make these types of modifications to the avatars. You'll need the Max files to make the changes and export a new Cal3D avatar.
The vizact.walkTo action will not take into account objects along the walking path. You can create a series of walkTo actions to avoid an obstacle.
If you need to generate random walking actions then use proximity sensors to find out if the avatar is close to an object. If it is, end the walk action on the avatar and add a new one.
You cannot perform collision on bones, only the entire avatar mesh. An alternative is to create an empty group node with a collision shape similar to the bone or avatar area where you want to detect collisions. Then link the group node to the bone.
This is possible if you own the Complete Character set which comes with all the associated 3ds Max files for the avatars. This set already includes many animations you don't see with the built-in avatars and may have what you are looking for. For custom animations you can either develop them using keyframe animation or with a motion capture system. Both will require you have the original max files and that you export the finished animation to Cal3D, Vizard's native avatar format.
The HD Complete Characters include facial bones that you can manipulate to create expressions.
For the standard Complete Characters, it's necessary to create a morph target in 3ds Max for each facial expression you want. The morphs that are included with the characters allow for blinking, speaking, and eyebrow raising. Take a look at the Blinking Avatars tech tip for example code to control these morphs in Vizard.
There is an example file in the Vizard install path under \examples\avatar\linkbones.py.
Using the <bone>.lookAt command you can orient the avatar's neck and head bones to face the user. The Animating Bones tutorial shows how to use this command to maintain eye contact. If you need more advanced behaviour, such as having the avatar's head smoothly turn and then make contact, try the WatchNode example code.
A lot can happen between the beginning and the ending of a virtual world. Tasks (created with the viztask module) are useful for controlling the order of events. They are functions that can pause and wait for a condition to be met, like a key press or an action to end, before they proceed. While the task function is waiting, the rest of the program runs uninterrupted. An example would be an interaction with an avatar where the avatar would speak, wait for a user response and then walk away.
Tasks are also helpful for splitting up your program into different periods of activity. For example, if you have a training simulation or experiment with various phases you can use a task function to wait until one phase is done and then set another in motion.
For more information on viztask, look under Flow control in both the tutorial and reference sections of the Vizard help. The Program flow section in Vizard Teacher in a Book (available as a free download) also has a description of this module with example code.
The vizact library includes a variety of actions you can use to easily animate models and avatars.
Animation paths allow you specify points in time where a change in position, size, or orientation occurs for the object travelling along the path.
Callback functions can be used to update an object's transform or other property frame by frame (Generally there is no need for this because one of the methods described above can be used instead).
To disable a callback that has been registered using the vizact library use <EventFunction>.setEnabled(viz.OFF).
Otherwise, disable a callback by setting the function to the value 0. For example, you would use the following code to disable a sensor button callback:
To resume the callback set the function back to the original value:
The viztask module and viz.director functions have similar functionality; however, there are important differences. Calling viz.director actually creates a new thread, while scheduling a task does not. This means that calling a long blocking operation in a task will block the Vizard update loop as well and the frame rate will go to zero. However, in most cases, tasks should be used because they are much more CPU/memory efficient and are non-preemptive so synchronization locks are not necessary. Director functions should only be used for performing IO operations that would otherwise halt the rendering of the world or the execution of other code (e.g. reading data from a large file, downloading a file from the Internet)
To stop all the timers but keep the world open, use viz.pause(). To resume the timers, use viz.play().
In Vizard, it is important to note that the linear unit of measurement is meters. This is especially important to remember when obtaining 3D models from 3rd party sources because their units may not be in meters, in which case the objects may appear extremely large or small when imported into Vizard.
This is often a result of trying to use a texture map that exceed the maximum 2D image resolution of Vizard.
Vizard supports any video or sound file format for which your system has a codec. One of the most common problem with media files is not having the correct codec (compression/decompression algorithm) installed on your system. Some applications (e.g. WMP, VLC) may have embedded codecs allowing them to play files that Vizard can't. If Vizard reports an error when loading a file, installing a codec pack may fix the problem.
Yes, there are several ways. Vizard comes with a built-in screen recorder. Another excellent solution is a 3rd party tool called Fraps.
With a webcam and a few lines of code added to your script, a user can be displayed alongside the virtual scene they are viewing. By recording it all with software like Fraps, you can easily create a picture-in-picture video demo.
The following code shows the Vizard gallery with webcam video mapped to a texture quad in the corner of the screen:
Take a look at the Light Baking page for instructions on baking complete maps and light maps.
By default, textures are resized to a power of two. You can use the texture.hint command with the viz.ALLOW_NPOT_TEXTURE_HINT flag to allow non-power-of-two textures if this is supported by your graphics card.
The size of the texture may be larger than the maximum texture size allowed by your graphics card. Run the following code to determine this value:
If you want to use a very large texture, split it up into smaller textures and tile the textures on your object.
You will need to use alpha masks in order for transparency to work in Vizard. The jpg image format does not support alpha masks, so if you're using a jpg you will need to convert the image to some other format, such as tif or png. Within the appropriate format, give the black areas an alpha value of 0. Microsoft Office comes with a handy program call Microsoft Photo Editor. You can open your image with this program and use the "Set Transparent Color" tool to make the black areas transparent. Then make sure you save the image to tif or png format.
When you apply a texture material in 3DMax you should only use UVW modifiers to adjust the texture parameters. Adjusting them directly within the material editor does not carry through to Vizard.
For viewing on an external display (e.g 3D monitor, shutterglasses) screen distance is important. WorldViz suggests that you correctly set the screen distance to your display(see <window>.screenDistance), the vertical field-of-view of the display (see viz.fov), and the user's ipd (see viz.ipd) when creating compelling and accurate 3D visualizations.
If you want to exaggerate the stereo effect you can change the window.fusionDistance setting. This command is not normally used for setting up correct 3D viewing. If you want an object to pop out of the screen more, then you would use a higher fusion distance value. This causes all objects less than that amount of distance from the virtual viewpoint to appear in front of the screen in 3D. By default, the fusion distance value will be the same as the screen distance value.
For a full discussion of stereoscopic rendering and HMD versus external displays, refer to the Stereoscopic Rendering page.
If you video card supports quad buffered stereo and the stereo setting is enabled use:
to initialize this stereo mode in your Vizard program.
The vizcave documentation includes example scripts for setting up both a powerwall and multi-wall CAVE in Vizard.
The default vertical FOV for the Vizard display is 40 degrees; the aspect ratio is automatically computed based on the window size. To change this, use viz.fov(verticleFOV, aspect ration).
This can be set within the graphics card's control panel. To set this in Vizard, use the viz.ipd(IPD) command. Instead of the default interpupillary distance of 0.06 meters, specify the distance as -0.06 meters.
Most 3D graphics programs that rely on hardware accelerated hidden surface removal always have a finite depth range. Vizard uses hardware z-buffering exclusively for hidden surface removal, as do most other rendering APIs.
As such, you can use the viz.clip() command to fine tune the range. Keep in mind your depth resolution (the minimum distance the computer can distinguish in depth) will be spread over this range. You're noticing that far objects are disappearing. Try increasing the far range:
that sets the nearest range to 0.5 and the farthest to 1000 meters. If that's still not far enough, increase the far (e.g., to 5000). If you will never view an object closer than say 2 meters, then you'll get better z-buffer performance if you then correspondingly increase your near distance (e.g., viz.clip(2.0, 5000)).
If you set the range to be too wide (e.g., viz.clip(0.001, 1000000000)), you'll notice jagged slices through all your objects because the algorithms cannot exactly distinguish which objects are closer to viewpoint than others.
You can prevent a node from rendering to a specific eye in stereo using the <node3D>.disable command with either the viz.RENDER_RIGHT or viz.RENDER_LEFT flag. In the following example, a ball is displayed to only the left eye by disabling right eye rendering:
Access the viewpoint in your script using the following code:
For relative movement of the viewpoint, use view.move(). For movement within the world's coordinates, use view.setPosition([x,y,z]). For relative rotations, use view.setEuler() with the viz.REL_PARENT flag. For rotations within the world's coordinate system, use view.setEuler().
Yes. Turn on built-in collision detection by adding the following line to your script:
Vizard will automatically check for collisions between the viewer and the world. If the viewer collides with an object it will stop the viewer from moving past it.
The command <viewpoint>.setEuler will rotate the head (and not the body) by default. You can however, rotate the body (and the head will rotate with it). To do so, use the flag below:
The following should disable mouse navigation:
Try the viz.mouse.setScale command. It let's you change the gain for both navigation translation and rotations. To just go faster forward but keep the same turn feel, try something like:
This will triple your translation speed but keep your rotations untouched.
Yes, you just need to configure the IDE to run the Vizard script using winviz.exe, which is located in the Vizard \bin directory. Our knowledge base contains step-by-step instructions on how to configure some of the more popular Python IDEs to run Vizard scripts.
Yes, the following knowledge base article describes how to do this:
You must make sure that the inertial sensor's coordinate system is aligned with PPT's coordinate system. If that's not the case, your movement direction will be off by the degree of the initial offset. The tracker resets tech tip describes several ways to perform the alignment using vizconnect:
When adding your Intersense, specify the COM port the device is connected to.
An Nvidia Quadro card is required to use the 3D Vision glasses with Vizard. The drivers do not support using 3D Vision with OpenGL applications on GeForce cards.
If you have an nvidia Quadro card and meet all the 3D Vision requirements then use the following in Vizard to initialize stereo:
Worldviz generally recommends the high end Nvidia GeForce cards. If you need frame sequential stereo then we recommend an Nvidia Quadro card.
The amount of memory available to Vizard is limited by one of three factors; system memory, GPU memory, and Vizard version (32/64 bit). Programs running on 32-bit versions of Windows by default are limited to 2 GB of memory. This means that even if you have more memory installed in your host computer, Vizard 32-bit will not be able to access it. With Vizard 64-bit the memory bottleneck is determined by whichever is less, system or GPU memory.
Note: If you add "/3GB" to your boot.ini file, then Windows 32-bit will allow you to access up to 3 GB of memory for a single application (1 GB is always set aside for the OS)
You can build a cluster on the same machine and thus leverage multiple GPUs. Under this scenario, each cluster instance can access a total amount of RAM according to the description in FAQ 8.5. Keep this in mind when running two GPUs—you may well need a machine that has 8 or more GB RAM to render full throttle. The supported GPU configurations are NVidia Quadro and AMD Radeon / FireGL.
There are a variety of factors that can affect performance such as graphics content, hardware, and Windows settings. Take a look at the Performance page for more on this topic.
Yes. Go here for details on how to do it:
Yes, you can use the 3rd party pywin32 library along with the Microsoft Speech SDK to perform voice recognition in Python. The following knowledge base article describes how to do this.