R3Graphics Package
Description:
The R3Graphics package supports classes needed for
rendering scenes.
It contains classes representing lights (directional, point, and spot),
material properites (brdfs, textures), and camera-viewport mappings
(camera, viewport, viewer). It also contains a simple representation
(scene), which is made up of a list of lights and a list of nodes
(each of which is a shape with a material). Function(s) for reading
scenes from files are included in R3Io.h.
List of Classes:
List of Functions:
-
File input:
- R3Io - reads a scene from a .ray file.
-
Base Classes:
-
Public Base Classes:
- None
-
Member Functions:
-
Constructor functions:
- R2Texture(void);
- R2Texture(const R2Texture& texture);
- R2Texture(const R2Image *image);
- R2Texture(const char *filename);
- ~R2Texture(void);
-
-
Property functions/operators:
- const R2Image *Image(void) const;
- const RNBoolean IsTransparent(void) const;
- const RNFlags Flags(void) const;
- const int ID(void) const;
-
-
Manipulation functions/operations:
- void SetImage(const R2Image *image);
-
-
Draw functions/operations:
- void Load(void) const;
- void Unload(void) const;
- void Draw(void) const;
-
-
Base Classes:
-
Public Base Classes:
- None
-
Member Functions:
-
Constructor functions:
- R2Viewport(void);
- R2Viewport(int xmin, int ymin, int width, int height);
-
-
Property functions/operators:
- const int XMin(void) const;
- const int YMin(void) const;
- const int XMax(void) const;
- const int YMax(void) const;
-
-
Property functions/operators:
- const int Width(void) const;
- const int Height(void) const;
- const int XCenter(void) const;
- const int YCenter(void) const;
- const int Area(void) const;
-
-
Manipulation functions/operators:
- void Move(int xmin, int ymin);
- void Resize(int width, int height);
- void Resize(int xmin, int ymin, int width, int height);
-
-
Base Classes:
-
Public Base Classes:
- None
-
Member Functions:
-
Constructor functions:
- R3Brdf(void);
- R3Brdf(const R3Brdf& brdf);
- R3Brdf(const RNRgb& rgb,
- RNScalar shininess = 0.0,
- RNScalar opacity = 1.0,
- RNScalar indexofrefraction = 1.0);
- R3Brdf(RNScalar red, RNScalar green, RNScalar blue,
- RNScalar shininess = 0.0,
- RNScalar opacity = 1.0,
- RNScalar indexofrefraction = 1.0);
- R3Brdf(const RNRgb& ambient,
- const RNRgb& diffuse,
- const RNRgb& specular,
- const RNRgb& emission,
- RNScalar shininess = 0.0,
- RNScalar opacity = 1.0,
- RNScalar indexofrefraction = 1.0);
-
-
Property functions/operators:
- const RNRgb& Ambient(void) const;
- const RNRgb& Diffuse(void) const;
- const RNRgb& Specular(void) const;
- const RNRgb& Emission(void) const;
- const RNScalar Shininess(void) const;
- const RNScalar Opacity(void) const;
- const RNScalar IndexOfRefraction(void) const;
- const int IsAmbient(void) const;
- const int IsDiffuse(void) const;
- const int IsSpecular(void) const;
- const int IsEmissive(void) const;
- const int IsShiny(void) const;
- const int IsTransparent(void) const;
- const RNFlags Flags(void) const;
- const int ID(void) const;
-
-
Manipulation functions/operations:
- void SetAmbient(const RNRgb& rgb);
- void SetDiffuse(const RNRgb& rgb);
- void SetSpecular(const RNRgb& rgb);
- void SetEmission(const RNRgb& rgb);
- void SetShininess(RNScalar shininess);
- void SetOpacity(RNScalar opacity);
- void SetIndexOfRefraction(RNScalar indexofrefraction);
-
-
Draw functions/operations:
- void Load(void) const;
- void Draw(void) const;
-
-
Base Classes:
-
Public Base Classes:
- None
-
Member Functions:
-
Constructor functions:
- R3Camera(void);
- R3Camera(const R3CoordSystem &cs,
- RNAngle xfov, RNAngle yfov, RNLength neardist, RNLength fardist);
- R3Camera(const R3Point& origin, const R3Triad& triad,
- RNAngle xfov, RNAngle yfov, RNLength neardist, RNLength fardist);
- R3Camera(const R3Point& origin, const R3Vector& towards, const R3Vector& up,
- RNAngle xfov, RNAngle yfov, RNLength neardist, RNLength fardist);
- R3Camera(const R3Point& origin, RNAngle pitch, RNAngle yaw, RNAngle roll,
- RNAngle xfov, RNAngle yfov, RNLength neardist, RNLength fardist);
-
-
Property functions/operators:
- const R3Point& Origin(void) const;
- const R3Vector Towards(void) const;
- const R3Vector& Backwards(void) const;
- const R3Vector& Up(void) const;
- const R3Vector Down(void) const;
- const R3Vector& Right(void) const;
- const R3Vector Left(void) const;
- const RNAngle Pitch(void) const;
- const RNAngle Yaw(void) const;
- const RNAngle Roll(void) const;
- const RNAngle XFOV(void) const;
- const RNAngle YFOV(void) const;
- const RNLength Near(void) const;
- const RNLength Far(void) const;
- const R3Triad& Triad(void) const;
- const R3CoordSystem& CoordSystem(void) const;
- const R3Halfspace Halfspace(RNDirection dir, RNDimension dim) const;
- const R4Matrix Perspective(void) const;
-
-
Manipulation functions/operators:
- void Reset(const R3Point& origin, const R3Vector& towards, const R3Vector& up);
- void Reposition(const R3Point& origin);
- void Reorient(const R3Vector& towards, const R3Vector& up);
- void Reorient(RNAngle pitch, RNAngle yaw, RNAngle roll);
- void SetCoordSystem(const R3CoordSystem& cs);
- void SetOrigin(const R3Point& origin);
- void SetTowards(const R3Vector& towards);
- void SetBackwards(const R3Vector& backwards);
- void SetUp(const R3Vector& up);
- void SetDown(const R3Vector& down);
- void SetRight(const R3Vector& right);
- void SetLeft(const R3Vector& left);
- void SetPitch(RNAngle pitch);
- void SetYaw(RNAngle pitch);
- void SetRoll(RNAngle pitch);
- void SetFOV(RNAngle xfov, RNAngle yfov);
- void SetXFOV(RNAngle xfov);
- void SetYFOV(RNAngle yfov);
- void SetNear(RNLength neardist);
- void SetFar(RNLength fardist);
-
-
More manipulation functions/operators:
- void Translate(const R3Vector& translation);
- void Rotate(const R3Vector& axis, RNAngle dtheta);
- void RotatePitch(RNAngle dpitch);
- void RotateYaw(RNAngle dyaw);
- void RotateRoll(RNAngle droll);
- void Transform(const R3Transformation& transformation);
-
-
Draw functions/operators:
- void Load(void) const;
- void Draw(void) const;
- void Outline(void) const;
-
-
Base Classes:
-
Public Base Classes:
- R3Light
-
Member Functions:
-
Constructor functions:
- R3DirectionalLight(void);
- R3DirectionalLight(const R3DirectionalLight& light);
- R3DirectionalLight(const R3Vector& direction, const RNRgb& color,
- RNScalar intensity = 1.0, RNBoolean active = TRUE);
-
-
Property functions/operations:
- const RNBoolean IsActive(void) const;
- const RNScalar Intensity(void) const;
- const RNRgb& Color(void) const;
- const R3Vector& Direction(void) const;
-
-
Manipulation functions/operations:
- virtual void SetActive(RNBoolean active);
- virtual void SetIntensity(RNScalar intensity);
- virtual void SetColor(const RNRgb& color);
- virtual void SetDirection(const R3Vector& direction);
-
-
Geometry evaluation functions:
- virtual RNScalar IntensityAtPoint(const R3Point& point) const = 0;
- virtual R3Vector DirectionFromPoint(const R3Point& point) const = 0;
-
-
Draw functions/operations:
- virtual void Draw(int i) const;
-
-
Class type definitions:
- RN_CLASS_TYPE_DECLARATIONS(R3DirectionalLight);
-
-
Base Classes:
-
Public Base Classes:
- None
-
Member Functions:
-
Constructor functions:
- R3Light(void);
- R3Light(const R3Light& light);
- R3Light(const RNRgb& color, RNScalar intensity = 1.0, RNBoolean active = TRUE);
-
-
Property functions/operations:
- const RNBoolean IsActive(void) const;
- const RNScalar Intensity(void) const;
- const RNRgb& Color(void) const;
-
-
Manipulation functions/operations:
- virtual void SetActive(RNBoolean active);
- virtual void SetIntensity(RNScalar intensity);
- virtual void SetColor(const RNRgb& color);
-
-
Geometry evaluation functions:
- virtual RNScalar IntensityAtPoint(const R3Point& point) const = 0;
- virtual R3Vector DirectionFromPoint(const R3Point& point) const = 0;
-
-
Draw functions/operations:
- virtual void Draw(int i) const = 0;
-
-
Class type definitions:
- RN_CLASS_TYPE_DECLARATIONS(R3Light);
-
-
Base Classes:
-
Public Base Classes:
- R3Attribute
-
Member Functions:
-
Constructor functions:
- R3Material(void);
- R3Material(const R3Material& material);
- R3Material(const R3Brdf *brdf);
- R3Material(const R2Texture *texture);
- R3Material(const R3Brdf *brdf, const R2Texture *texture);
-
-
Material property functions/operations:
- const R3Brdf *Brdf(void) const;
- const R2Texture *Texture(void) const;
- const RNFlags& Flags(void) const;
- const RNBoolean IsReflective(void) const;
- const RNBoolean IsAmbient(void) const;
- const RNBoolean IsDiffuse(void) const;
- const RNBoolean IsSpecular(void) const;
- const RNBoolean IsEmissive(void) const;
- const RNBoolean IsShiny(void) const;
- const RNBoolean IsTextured(void) const;
- const RNBoolean IsTransparent(void) const;
-
-
Manipulation functions/operations:
- void SetBrdf(const R3Brdf *brdf);
- void SetTexture(const R2Texture *texture);
- void Update(void);
-
-
Draw functions/operations:
- void Draw(void) const;
-
-
Base Classes:
-
Public Base Classes:
- None
-
Member Functions:
-
Constructor functions:
- R3Node(R3Shape *shape, R3Brdf *brdf);
-
-
Properties:
- const R3Shape *Shape(void) const;
- const R3Brdf *Brdf(void) const;
- const R3Box& BBox(void) const;
-
-
Ray intersection functions:
- RNClassID Intersects(const R3Ray& ray,
- R3Point *hit_point = NULL, R3Vector *hit_normal = NULL,
- RNScalar *hit_t = NULL) const;
-
-
Draw functions:
- void Draw(const R3DrawFlags draw_flags = R3_DEFAULT_DRAW_FLAGS) const;
-
-
Class type definitions:
- RN_CLASS_TYPE_DECLARATIONS(R3Node);
-
-
Base Classes:
-
Public Base Classes:
- R3Light
-
Member Functions:
-
Constructor functions:
- R3PointLight(void);
- R3PointLight(const R3PointLight& light);
- R3PointLight(const R3Point& position, const RNRgb& color,
- RNScalar intensity = 1.0, RNBoolean active = TRUE);
-
-
Property functions/operators:
- const RNBoolean IsActive(void) const;
- const RNScalar Intensity(void) const;
- const RNRgb& Color(void) const;
- const R3Point& Position(void) const;
-
-
Manipulation functions/operations:
- virtual void SetActive(RNBoolean active);
- virtual void SetIntensity(RNScalar intensity);
- virtual void SetColor(const RNRgb& color);
- virtual void SetPosition(const R3Point& position);
-
-
Evaluation functions:
- virtual RNScalar IntensityAtPoint(const R3Point& point) const;
- virtual R3Vector DirectionFromPoint(const R3Point& point) const;
- virtual RNScalar RadiusOfInfluence(RNScalar intensity) const;
- R3Sphere SphereOfInfluence(RNScalar intensity) const;
-
-
Draw functions/operations:
- virtual void Draw(int i) const;
-
-
Class type definitions:
- RN_CLASS_TYPE_DECLARATIONS(R3PointLight);
-
-
Base Classes:
-
Public Base Classes:
- None
-
Member Functions:
-
Constructor functions:
- R3Scene(void);
-
-
Access functions:
- const int NLights(void) const;
- const R3Light *Light(int k) const;
- const int NNodes(void) const;
- const R3Node *Node(int k) const;
- const R3Camera *Camera(void) const;
-
-
Manipulation functions:
- void InsertLight(R3Light *light);
- void InsertNode(R3Node *node);
- void SetCamera(R3Camera *camera);
-
-
Geometric properties:
- const R3Box& BBox(void) const;
-
-
Ray intersection functions:
- RNClassID Intersects(const R3Ray& ray,
- R3Node **hit_node = NULL, R3Point *hit_point = NULL,
- R3Vector *hit_normal = NULL, RNScalar *hit_t = NULL) const;
-
-
Draw functions:
- void Draw(const R3DrawFlags draw_flags = R3_DEFAULT_DRAW_FLAGS) const;
-
-
Class type definitions:
- RN_CLASS_TYPE_DECLARATIONS(R3Scene);
-
-
Base Classes:
-
Public Base Classes:
- R3PointLight
-
Member Functions:
-
Constructor functions:
- R3SpotLight(void);
- R3SpotLight(const R3SpotLight& light);
- R3SpotLight(const R3Point& position, const R3Vector& direction,
- const RNRgb& color, RNScalar dropoffrate = 0.0, RNAngle cutoffangle = 0.785398,
- RNScalar intensity = 1.0, RNBoolean active = TRUE);
-
-
Property functions/operators:
- const RNBoolean IsActive(void) const;
- const RNScalar Intensity(void) const;
- const RNRgb& Color(void) const;
- const R3Vector& Direction(void) const;
- const RNScalar DropOffRate(void) const;
- const RNAngle CutOffAngle(void) const;
-
-
Manipulation functions/operations:
- const RNBoolean IsActive(void) const;
- const RNScalar Intensity(void) const;
- const RNRgb& Color(void) const;
- virtual void SetDirection(const R3Vector& direction);
- virtual void SetDropOffRate(RNScalar dropoffrate);
- virtual void SetCutOffAngle(RNAngle cutoffangle);
-
-
Evaluation functions:
- virtual RNScalar IntensityAtPoint(const R3Point& point) const;
- virtual R3Vector DirectionFromPoint(const R3Point& point) const = 0;
-
-
Draw functions/operations:
- virtual void Draw(int i) const;
-
-
Class type definitions:
- RN_CLASS_TYPE_DECLARATIONS(R3SpotLight);
-
-
Base Classes:
-
Public Base Classes:
- None
-
Member Functions:
-
Constructor functions:
- R3Viewer(void);
- R3Viewer(const R3Viewer& viewer);
- R3Viewer(const R3Camera& camera, const R2Viewport& viewport);
-
-
Viewer property functions/operators:
- const R3Camera& Camera(void) const;
- const R2Viewport& Viewport(void) const;
-
-
Camera manipulation functions/operators:
- void SetCamera(const R3Camera& camera);
- void RepositionCamera(const R3Point& eyepoint);
- void TranslateCamera(const R3Vector& translation);
- void ReorientCamera(const R3Vector& towards, const R3Vector& up);
- void RotateCamera(const R3Vector& axis, RNAngle dtheta);
- void RotateCameraPitch(RNAngle dpitch);
- void RotateCameraYaw(RNAngle dyaw);
- void RotateCameraRoll(RNAngle droll);
- void ResetCamera(const R3Point& eyepoint, const R3Vector& towards, const R3Vector& up);
-
-
Viewport manipulation functions/operators:
- void SetViewport(const R2Viewport& viewport);
- void MoveViewport(int xmin, int ymin);
- void ResizeViewport(int width, int height);
- void ResizeViewport(int xmin, int ymin, int width, int height);
-
-
World manipulation functions/operators:
- void TranslateWorld(const R3Vector& translation);
- void ScaleWorld(const R3Point& origin, RNScalar factor);
- void RotateWorld(const R3Point& origin, const R3Vector& normal, RNAngle dtheta);
- void RotateWorldPitch(const R3Point& origin, RNAngle dpitch);
- void RotateWorldYaw(const R3Point& origin, RNAngle dyaw);
- void RotateWorldRoll(const R3Point& origin, RNAngle droll);
-
-
Camera-in-hand user interface utility functions:
- virtual void TranslateCamera(RNScalar factor, int x, int y, int dx, int dy);
- virtual void RotateCamera(RNScalar factor, int x, int y, int dx, int dy);
- virtual void RotateCameraPitch(RNScalar factor, int x, int y, int dx, int dy);
- virtual void RotateCameraYaw(RNScalar factor, int x, int y, int dx, int dy);
- virtual void RotateCameraRoll(RNScalar factor, int x, int y, int dx, int dy);
- virtual void FlyCamera(RNScalar pitch_factor, RNScalar yaw_factor, RNScalar roll_factor,
- RNScalar step_factor, RNBoolean relax_yaw, RNBoolean relax_roll, int x, int y, int dx, int dy);
- virtual void WalkCamera(RNScalar pitch_factor, RNScalar yaw_factor, RNScalar roll_factor,
- RNScalar step_factor, RNBoolean relax_yaw, RNBoolean relax_roll, int x, int y, int dx, int dy);
-
-
World-in-hand user interface utility functions:
- virtual void TranslateWorld(RNScalar factor, const R3Point& origin, int x, int y, int dx, int dy);
- virtual void ScaleWorld(RNScalar factor, const R3Point& origin, int x, int y, int dx, int dy);
- virtual void RotateWorld(RNScalar factor, const R3Point& origin, int x, int y, int dx, int dy);
- virtual void RotateWorldPitch(RNScalar factor, const R3Point& origin, int x, int y, int dx, int dy);
- virtual void RotateWorldYaw(RNScalar factor, const R3Point& origin, int x, int y, int dx, int dy);
- virtual void RotateWorldRoll(RNScalar factor, const R3Point& origin, int x, int y, int dx, int dy);
-
-
Camera/viewport relationship functions/operators:
- const R3Ray WorldRay(int x, int y) const;
- const R2Point ViewportPoint(const R3Point& point) const;
- const R2Box ViewportBBox(const R3Shape& shape) const;
- const R2Circle ViewportBCircle(const R3Shape& shape) const;
- const RNArea ViewportArea(const R3Shape& shape) const;
-
Click this to go back to main page.