Editing 3D Models

See how to use the Inspector Tool to edit 3D models before importing them into Vizible Presentation Designer.

Using Inspector to Edit Models

Vizible currently supports translate, rotate, and scale transformations. Until more editing capabilities are added directly to Vizible, we recommend our simple model editor called “Inspector”. This editor comes with WorldViz’s product called Vizard. The link below provides a Vizard installer that includes Inspector.

http://www.worldviz.com/releases/vizard5/

What is Inspector?

Inspector is a visual browser and editor for Vizard / OpenSceneGraph (OSG) compatible 3D models.

What is Vizard?

Vizard is a comprehensive virtual reality development platform that allows for connecting a wide range of hardware types (displays, trackers, input devices, and transports). Providing an interface in python and designed for rapid prototyping, it has its own rendering and physics engine.

When would I use Inspector?

You can use Inspector to:

  • Check Render stats (to determine if your model will run well in VR)
  • Swap out textures
  • Locate and move your origin point
  • Identify sub-parts of models so that you can get a handle to and manipulate them
  • View polygon and texture information for the model and sub-parts (If the model is negatively affecting performance, this can help you determine the cause.)
  • Move, rotate, and scale the model and its sub-parts.
  • Add, delete, and move nodes within the scene graph.
  • Edit model properties such as node names and colors.
  • Remove and/or add components
  • Add or remove lighting and adjust lighting parameters
  • Check your model’s scale
  • Save to any Vizible supported file formats including its native osgb format
  • Change or compress textures and texture properties
  • Delete or modify the model hierarchical structure

Getting Inspector

To get Vizard and Inspector you can follow this direct download link for Vizard

Opening Inspector

If you have Vizard installed you can open Inspector by searching for “Inspector” in your Windows search bar and then clicking on the “Vizard Inspector” app.

Checking Render Statistics

Press F4 to see the render stats. The first value ‘fps’ gives some indication of how well this scene will perform when rendered in real time VR. The Oculus and Vive, for example, both run at 90 fps so ideally the scene will render at or above that. A high drawable count that is more than a few thousand will cause frame rate drops. The term drawable is used in the Vizard context to define an object that Vizard performs a cull check on each frame. The exact number that can be supported without frame drops depends on the GPU used as well as other aspects of the scene (e.g. polygons, textures, real time lights etc.) What tends to cause high drawable counts are trees, plants, and other components that contain hundreds or thousands of individual parts.

An issue common to models taken from the 3DWarehouse (like this one) is with foliage. In most cases where the foliage looks good, it doesn’t render very well in real time. There are optimizations that are possible to reduce drawables but not in the direct SU to Vizard workflow (e.g. using 3ds Max as intermediary). The only choice here to render at a decent rate is to either remove or reduce the amount of foliage in the scene.

Locating and Moving the Origin Point

Look at the world origin represented by the red, green, and blue axes. The origin is near the lower left corner of the scene model:

RGB equals XYZ coordinates in Inspector and Vizard’s coordinate system. Understanding the coordinate system is helpful for moving and placing models in the scene:

  • Direction of red line is +X
  • Direction of green line is +Y
  • Direction of blue line is +Z

In a Vizard application the position of the camera (also called the viewpoint) is directly above the origin by default. For the purpose of Vizard it usually makes sense to place the part of the scene model where the user will begin their VR simulation at this origin. In this scenario, the user should be start off in front of the house. To make this happen either the model needs to be moved in SU and then exported again or the model should be moved in Inspector.

Below are instructions of one way of doing this in Inspector:

To move the scene in Inspector first determine where you want the user to be. Do that by navigating within the model to the location. Next check the camera position as shown in the status bar at the bottom. Here it’s about [19,1.8,1]

In the scene graph, double click on the top level node with the gear icon called ‘house’ Activate translate mode and make sure the transform mode is set to Global Either use the transform gizmo in the viewer to move the house or enter the negation of the camera values in the type in boxes above the viewer. The Y value can be left at 0:

Click anywhere in the scene to deselect the house node and verify the origin axes is at the desired location

Go to File > Save to save the changes to house.osgb

Checking the model scale

Select the top level node in the scenegraph (house) to select the entire model and look at the bounding box dimensions of the selection in the status bar at the bottom of the window. In this case the bounding box is [42.71,12.34,79.58]. The width value of 42.71 is similar to the width measured in SU (41.36). The bounding box expands to contain all geometry in the model and some of the trees extend slightly beyond the ground area.

Next, in the viewer, select the sidewalk towards the front of the model and look at the bounding box dimensions. The X dimension shows 41.36 meter which matches exactly with the measurement we took in SU. This confirms the exported model is scaled correctly for Vizard:

Note

If the model scale was incorrect, the model may still look correct in the viewport but the bounding box dimensions might be very small or large.

Lighting in Inspector

Lighting and shadows do not carry over from some modeling tools such as Sketchup. Lights can be added in Inspector, in the Vizard script, or both. By default a head light is enabled that illuminates whatever is in front of the viewpoint. Directional, Spot, and Point Lights can be added and positioned anywhere in the scene. Additional processing power is required for each light added to the scene and there is a limit of 8 custom lights (7 if the head light is enabled). Lighting calculations are different depending on whether ‘Effects’ are enabled or disabled.

Effects Enabled

  • Per pixel lighting is calculated on the model
  • Shadows can optionally be enabled.
  • Ambient light can be added to the scene
  • Requires more processing power

Effects Disabled

  • Per vertex lighting is calculated on the model
  • Shadows and Ambient light not supported
  • Requires less processing power

Adding Custom Lights

Custom lights are added through the Create > Light menu. Go ahead and add a directional light. Next enable translate or rotate mode to set the light’s position and orientation. The position of a directional light does not affect its output, but can be used to move the node’s icon to a more convenient location for visualizing it in Inspector:

The light color can be changed and shadows can be enabled for the light in the in the properties window:

In order to access this light and change it’s position/orientation in the Vizard script the light should have a name. In the scenegraph, right click on the light transform and rename it to ‘Sun’:

Adjusting Ambient Light

Enable Effects in the bottom right corner to see how ambient light will affect the model. To change the ambient light level:

  • Select the “Scene” root node in the scene graph window
  • In the properties window, click on the bar next to ‘Ambient Light’.
  • Drag the cursor in the color box

See the affect on the model of changing the amient color. To store the ambient level within the file check “Save Scene Settings” within the properties panel:

Go to File > Save to save the model with lights.

Swapping Textures

Browsing textures

The texture pane lists all the textures in the scene. Clicking a texture will display it in the viewport. If the texture contains an alpha channel, you can right-click the viewport and have it render only the RGB or Alpha channel. Expand the arrow sign to the left of the texture to see the object(s) that it’s applied to.

The textures pane contains the following columns for each texture:

NameThe texture name.DimensionThe width/height dimensions of the texture.Size (KB)The memory size of the texture in kilobytes.FormatThe pixel format of the texture (RGB, RGBA, …).CompressionIf the texture is compressed, the compression format (DXT1, DXT3, or DXT5).AnisotropyIf enabled, the anisotropic filter level of the texture.

Select the object you want to swap textures on.

On the right you will see the textures assigned to that object under the “materials” menu. In this window you also have many other options for your material, such as whether to have lighting on or off, culling, blending, draw order and assign colors to your diffuse, specular, ambient, alpha, and shininess maps.

To change a texture double click on the texture unit and a new window will open up. Click on the folder icon in the top right and navigate to your new texture.

Your new texture is now applied

Change lighting for viewing in Inspector Only

There are different ways of lighting the model in Inspector without actually changing the model. Go to View > Lighting and try out the Off, Sky, and Head options.

  • Off: Often used when adding ambient or custom lights
  • Sky: Similar to adding a directional light that points downwards
  • Head: A head light that illuminates whatever is in front. This is the same as the default lighting in Vizard