showcam

Synopsis

Shows a geometric icon for the camera along with the scene objects in a second view. Allows the camera position to be viewed as it is manipulated.

Input Ports

Name Type Description

camera_in GDcamera camera object extracted from Uviewer component.
glyph_in Mesh geometry that should be used to represent the camera.

Output Ports

Name Type Description

out_fld Field output field containing the transformed input glyph.
out_obj DataObject directly renderable output object.

Description

This project is intended to show how the camera producing one view can be seen in another. Doing this has many applications; in particular it will be very useful in educational applications and when very fine control of the camera position is required. The ability to visualise how you interact with the view is particularly important within AVS/Express because of the way that both objects and the camera can be interacted. AVS/Express uses separate transformations for both the scene objects and the camera objects. For many users this distinction is initially not clear or obvious. However by being able to view both the scene and the camera viewing that scene the distinction is much easier to see.

Placing a 'camera' glyph at the camera position initially appears to be a trivial problem. However the camera transformation actually causes the glyph to appear in the 'inverse' location, with incorrect rotation. To solve this the camera transformation must first be inverted before it is used to transform the camera glyph. This is done by the prep_cam_xform low-level module. The low-level module also changes the translation of output transformation.

The showcam functional macro builds on the prep_cam_xform module. It also takes the generated transformation and uses it to transform the input glyph geometry. Typically this geometry will be the supplied CameraGlyph macro. However any glyph geometry could be used.

By using the showcam macro the camera transformation is used to position a camera glyph in a second view. The objects in the second view also have to be transformed before the second view is completed. This is done in the example application by extracting the object transformation of the first view from the Uviewer component, and using a GroupObject to apply that transformation to all the scene objects viewed in the second view.

Inputs

camera_in

Connection to the camera that is to be viewed in a second window. The camera is not normally exported from the Uviewer component and this will have to be done manually. This can be seen in the ShowcamEg example application.

glyph_in

Connection to the geometric representation that should be used for the camera. Normally the supplied CameraGlyph macro can be used. However it is possible to use any normal glyph. For the 'camera' glyph to look correct the glyph should face along the negative Z axis, right should be along the positive X axis and up should be along the positive Y axis.

Outputs

out_fld

The glyph geometry transformed by the correct camera transformation.

out_obj

The directly renderable output of the showcam macro. The DataObject contained within this output is generated from the same data as that output by out_fld. This renderable output is the output that will normally be used.

Utility Macros

The CameraGlyph macro provides a simple camera geometry that can be used immediately to represent the camera position.

Example

An example application, ShowcamEg, is provided. It will be useful to give a brief walk through of how this application can be used. Once the application has been started it will open two windows and load the 'teapot' geometry supplied with AVS/Express. The teapot will appear in both windows. Select the window that does not show the camera object.

First try rotating the teapot itself. The transform object button should be selected by default. If it is not press it. You should see that the teapot in the second window also rotates. Next try moving the camera. This can be done by selecting the transform camera button. This button should have a camera icon on it. If you attempt to rotate the scene now you should see that the teapot stays still and the camera moves.

All movements of either the teapot or the camera in the first window should be reflected in the second window. Unfortunately it is not currently possible to move the camera in the second window and have the view seen by the first window change.

Files

iac_proj/showcam/shcmods.v contains the V definitions of the prep_cam_xform module and the CameraGlyph macro.

iac_proj/showcam/shcmacs.v contains the V definitions of the showcam Functional macro and the ShowcamEg example application.

Prerequisites

This project relies on the successful installation of the following components. Without them it will not function correctly.

Other Notes

The low-level ShowcamMods library containing the module prep_cam_xform does not specify a process. By default the express process will be used.

Authors

John Methot, Ian Curington
Advanced Visual Systems, Inc.
Andrew Dodd
International AVS Centre

Contact

International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL

See Also

n/a