Up: W3Kit Class Reference

W3MinneGraphics

Superclass: W3Input

An abstract W3Kit base class for 3D rendering via MinneGraphics (MG). The main subclass methods are renderMinneGraphics and mouseClick:.

MG is a portable front end for Iris GL, X11, Photorealistic Renderman, and Quick Renderman. MG was developed at the Geometry Center as part of its mathematical visualization program, Geomview.

Currently the W3MinneGraphics class supports the Quick Renderman and X11 drivers (how do you get IrisGL to render into a buffer?).

Transforms

The world-to-camera transform and the image size are stored as essential state. Transforms are 4-by-4 matrices which act on row vectors by right multiplication.

lookAtGeom:withTransform: roughly fills the view with a Geom, while maintaining the original line of sight through the center of the view as a (perhaps non-central) line of sight. Thus, if some part of the object was already visible at the center of picture it will generally still be visible after performing this method.

rotateToFront: peforms a simple rotation turning toward the viewer any vector whose tail is behind the center of the view and whose head is at the mouse hit on screen. The amount of rotation increases up to 90 degrees as the mouse hit nears the edge of the screen. The mouse click is specified in coords making viewport = [-1,1]x[-1,1].

- setIntSize:(const IntSize *)theSize;
- getIntSize:(IntSize *)theSize;
- setWorldToCameraTransform:(Transform)worldToCamera;
- getWorldToCameraTransform:(Transform)worldToCamera;
- getCameraToWorldTransform:(Transform)cameraToWorld;
- defaultWorldToCameraTransform;
- transformWorld:(Transform)moveWorld;
- transformCamera:(Transform)moveCamera;
- lookAtGeom:(Geom *)geom withTransform:(Transform)geomToWorld;
- lookAtGeom:(Geom *)geom withTransform:(Transform)geomToWorld
	fillView:(float)frac;
- rotateToFront:(const Point2 *)mouseClick;
- convertHPointWorld:(const HPoint3 *)wPoint toCamera:(HPoint3 *)cPoint;
- convertHPointCamera:(const HPoint3 *)cPoint toWorld:(HPoint3 *)wPoint;

Events and Display

Override these in subclass to customize appearance, event response. Mouse click is given in coords making camera viewport = [-1,1]x[-1,1].
- renderMinneGraphics;
- mouseClick:(const Point2 *)aPoint;
Different ways to route the rendering output.
- printHtml;         // print HTML for inlining the image
- display;           // send out-of-line image back to user and exit
- snapshotDocument;  // capture image in a W3Document (returned)
Subclasses can override this to adjust their alignment in the layout, relative to other widgets. The default value is "top".
- (const char *)htmlAlignment;

Rendering Parameters

Most of the paramters of the camera are non-essential state. They are parameters to be controlled by the Fill-Out Form, or otherwise just left to their default values.
- reset;
- setImageBitDepth:(int)bits;
- takeImageBitDepthFrom:sender;
- setIsShadingSmooth:(BOOL)yn;
- takeIsShadingSmoothFrom:sender;
- setDoesDrawFaces:(BOOL)yn;
- takeDoesDrawFacesFrom:sender;
- setDoesDrawEdges:(BOOL)yn;
- takeDoesDrawEdgesFrom:sender;
- setFieldOfView:(double)fov;
- takeFieldOfViewFrom:sender;
- setFaceColorA:(const ColorA *)aColor;
- takeFaceColorAFrom:sender;
- setEdgeColorA:(const ColorA *)aColor;
- takeEdgeColorAFrom:sender;
- setBackgroundColorA:(const ColorA *)aColor;
- takeBackgroundColorAFrom:sender;
- setAmbientColorA:(const ColorA *)aColor;
- takeAmbientColorAFrom:sender;
- setLightCount:(unsigned)num;
- setLightColorA:(const ColorA *)aColor at:(unsigned)index;
- setLightPosition:(const Point *)aPoint at:(unsigned)index;
- setLightIntensity:(double)frac at:(unsigned)index;
- takeLight1ColorAFrom:sender;
- takeLight1IntensityFrom:sender;
- takeLight1PositionFrom:sender;
- takeLight2ColorAFrom:sender;
- takeLight2IntensityFrom:sender;
- takeLight2PositionFrom:sender;
- takeLight3ColorAFrom:sender;
- takeLight3IntensityFrom:sender;
- takeLight3PositionFrom:sender;


Up: W3Kit Class Reference

[HOME] The Geometry Center Home Page

Author: Paul Burchard
Comments to: webmaster@www.geom.uiuc.edu
Created: Apr 18 1994 --- Last modified: Tue Jun 18 10:43:08 1996