librtl

rtl_world Class Reference

Encapsulation of a worlds' scene that can be rendered. More...

#include <world.h>

List of all members.

Public Members

Static Public Members


Detailed Description

Encapsulation of a worlds' scene that can be rendered.

The class also provides a set of functions for building the scene similarly to the OpenGL state machine. It should be noted that the view-volume is identical so a world-space modelview matrix from opengl will produce a rendering with the same view as the equivelent opengl image. See the matrix function for this.

Examples:
Polyhedrons, Simple, Soft and SuperEllipsoids.

Member Enumeration Type Documentation

enum rtl_world::composite

Symbolic names for composite CSG types.

Enumeration values:


Member Function Documentation

rtl_world::rtl_world( jFlt = 45.0, jFlt = 1000 )

Construct a new world. The world is given the field of view and the length of distance that infinity is. Infinity is required sometimes for bounds.

virtual void rtl_world::raytrace( jImage&, jInt=-1, jInt=-1, jInt=-1, jInt=-1 ) [virtual]

Render the scene. This version produces an image with heavy aliasing artifacts. The pixelmap passed will determine the resolution to sample the image at.

virtual void rtl_world::raytrace( jUInt, jUInt, jImage&, jInt=-1, jInt=-1, jInt=-1, jInt=-1 ) [virtual]

Render the scene. This version reduces the aliasing by introducing noise from jittered sampling. The pixelmap passed will determine the resolution to sample the image at.

Examples:
Polyhedrons, Simple, Soft and SuperEllipsoids.

jInt rtl_world::screenX() const

Returns the x-ccordinate of the pixel being rendered, garbage if the scene is not being rendered.

jInt rtl_world::screenY() const

Returns the y-ccordinate of the pixel being rendered, garbage if the scene is not being rendered.

void rtl_world::lookat( const jVec3&, const jVec3&, const jNorm3& )

Specification of viewing matrix. This allows the user to setup the camera position exactly. It is analogous to the gluLookat function. The three parameters are camera position, camera focal point and the world up vector. This matrix only affects the viewing and not the object transformation matrices.

Examples:
Polyhedrons, Soft and SuperEllipsoids.

const jVec3& rtl_world::camera() const

Camera position. Returns where the camera is relative to the current viewing matrix, (see lookat).

void rtl_world::identity()

Make current transformation matrix the identity matrix.

void rtl_world::translate( jFlt, jFlt, jFlt )

Translate the current modelview by the three values.

Examples:
Simple, Soft and SuperEllipsoids.

void rtl_world::scale( jFlt, jFlt, jFlt )

Scale the current modelview by the three values.

Examples:
Polyhedrons.

void rtl_world::rotate( int, jFlt )

Rotate the current modelview. The scene is rotated about the given axis (x,y,z is 0,1,2) and the given angle in degrees.

Examples:
SuperEllipsoids.

void rtl_world::matrix( const jMat4& )

Transform the current modelview by the given matrix.

void rtl_world::push()

Save the current state. The state encompasses the current modelview transformation and the current material, texture, and object construction tree.

Examples:
Soft and SuperEllipsoids.

void rtl_world::pop()

Restore the current state. The state encompasses the current modelview transformation and the current material, texture, and object construction tree.

Examples:
Soft and SuperEllipsoids.

void rtl_world::material( rtl_material* )

Specify the current material. The current material is what is assigned to an object passed to add, or created by end.

rtl_material* rtl_world::material()

Returns the current material. The current material is what is assigned to an object passed to add, or created by end.

Examples:
Simple, Soft and SuperEllipsoids.

void rtl_world::texture( rtl_texture* )

Specify the current texture. The current texture is assigned to materials on their addition into the scene.

rtl_texture* rtl_world::texture()

Returns the current texture. The current texture is assigned to materials on their addition into the scene.

Examples:
Soft.

const jMat4& rtl_world::top() const

Returns the current modelview transformation matrix. See identity, translate, rotate, scale and matrix.

void rtl_world::begin( composite )

Start the construction of a CSG object. The parameter specifies the boolean operation to use to combine the children. Begin and end should bracket the addition of two children (either through add, or another begin/end pair).

rtl_object* rtl_world::end( jULng = 0 )

Complete the construction of a CSG object. (See, begin.) The parameter is a bitmap to pass as the flag value for the object. End causes a new object to be created (see Union / Intersection / Difference) and added to the scene.

void rtl_world::add( rtl_object*, jULng = 0 )

Add an object to the scene. The parameter is a bitmap to pass as the flag value for the object.

Examples:
Polyhedrons, Simple, Soft and SuperEllipsoids.

void rtl_world::illumination( rtl_illumination& )

Set the illumination to compute ray intensities. This allows one to specify the illumination model used to compute light transfer through the scene.

void rtl_world::illumination( rtl_illumination* )

Set the illumination to compute ray intensities. This allows one to specify the illumination model used to compute light transfer through the scene.

rtl_illumination* rtl_world::illumination()

Gets the illumination model. This function will return the current illumination model that will be used to compute light transfer and thus pixel intensities for the render.

Examples:
Soft and SuperEllipsoids.

const jColour& rtl_world::ambient() const

Returns the ambient light in the scene. Ambient light is used to approximate diffuse inter-reflection. This colour should be close to black.

void rtl_world::ambient( const jColour& _amb )

Sets the ambient light in the scene. Ambient light is used to approximate diffuse inter-reflection. This colour should be close to black.

jFlt rtl_world::inifinity() const

Returns the value for infinity. Infinity is used for computing bounding boxes in some case.

jFlt rtl_world::fieldofview() const

Returns the field of view. The field of view is the angle between the vertical walls of the view frustrum, it is the angle over which the camera can see horizontal.

void rtl_world::fieldofview( jFlt _fov )

Sets the field of view. The field of view is the angle between the vertical walls of the view frustrum, it is the angle over which the camera can see horizontal.

const jBBox& rtl_world::bounds() const

Returns the scene bounding box (excluding infinite objects).

rtl_voxel* rtl_world::voxelspace()

Returns the space subdivision of the scene, this is the data structure that contains the collection of rtl_(sub)objects.

void rtl_world::progress( bool(*)(int, int, void*), void* )

Sets a callback for reporting progress. The function passed will be called after every rendered line. The second parameter is some data to pass to the function. The function is passed the current line, how many lines will be rendered and the data given during call to this function.

rtl_flags& rtl_world::flags()

Returns the flags for this object.

rtl_flags& rtl_world::flags()

Returns the flags for this object.

viewinfo* rtl_world::initView( jInt, jInt )

Initialize a view for shooting individual rays. Allocates and initializes the values in the viewinfo structure. Supply the resolution at which to sample the view plane.

bool rtl_world::shoot( viewinfo*, jInt, jInt, jColour&, jVec3& )

Shoot a single ray. Shoots a ray through the viewplane previously setup up with initView. Pass the screen space coordinate of the pixel to trace, The colour and world space location of the intersection are set if there was one. The function returns true if there was an intersection o/w it returns false.

void rtl_world::killViewInfo( viewinfo* )

Destroys an allocated viewinfo structure.


Member Data Documentation

const jULng rtl_world::ShowProgress [static]

Causes progress output on cerr. On by default.

const jULng rtl_world::InColour [static]

Causes the images to be rendered in colour. On by default.

rtl_world* rtl_world::current [static]

The rtl_world that is currently being rendered. This value gets set when any rendering function is called.


The documentation for this class was generated from the following file:
JSP / librtl v0.2 mtigges@cpsc.ucalgary.ca