Renderer
Description
- Derived from
-
Disposable abstract
IBeginEnd
ILineThickness
The Renderer class provides methods for performing basic 3D drawing.
To perform 3D drawing with a Renderer object, the following steps are required:
-
Create a Renderer object and pass an existing IGraphicsContext object.
-
Set the viewport bounds via Bounds or Fullscreen.
-
Configure the view transform by setting CameraParameters.ViewProjectionMatrix and CameraParameters.ViewProjectionFar of RendererParameters.Camera of Parameters.
-
Begin a new render cycle by calling IBeginEnd.Begin. The calls to IBeginEnd.Begin and IBeginEnd.End may be nested and must be balanced.
-
Use ILineThickness.LineThickness, PushTransform and PopTransform to update the render state.
-
Call DrawPrimitiveBegin to begin a new graphics primitive.
-
Call DrawPrimitiveVertex1 to add vertices to the current graphics primitive.
-
Call DrawPrimitiveEnd to finish the current graphics primitive.
-
Use DrawBox, DrawBoxSoup and DrawCuboid to draw geometric objects.
-
End the current render cycle by calling IBeginEnd.End.
From ISceneEntityView.Render3D, only the steps 5 to 9 need to be performed.
Public / Constructors
Renderer
Creates a new instance of Renderer.
- RenderException
-
If a graphics subsystem error has occurred.
Public / Methods
DrawBox
Draws the faces and edges of the given (axis-aligned) box.
This method delegates to DrawPrimitive*
, drawing a Primitive.TriangleList for the box faces (using colorFace in) and a Primitive.LineList for the box edges (using colorLine in).
- See also
DrawBoxSoup
Draws the given box soup.
This method delegates to DrawPrimitive*
, drawing a Primitive.TriangleList for the box faces (using colorFace in) and a Primitive.LineList for the box edges (using colorLine in).
- See also
DrawCuboid
Draws the given cuboid.
This method delegates to DrawPrimitive*
, drawing a Primitive.TriangleList for the cuboid faces (using colorFace in) and a Primitive.LineList for the cuboid edges (using colorLine in).
- See also
DrawPrimitiveVertex
3 overloads
Specifies the next vertex for the current 3D primitive.
Specifies the next vertex for the current 3D primitive.
Specifies the next vertex for the current 3D primitive.
Fullscreen
Sets the Bounds of this Renderer object to full-screen (i.e. the size of the current render target, see IGraphicsContext.Size).
PushTransform
Appends the given transformation to the current one and uses the result for all subsequent 3D primitives.
- See also
Reset
Resets the render state to default values.
This method is called automatically when the outermost call to IBeginEnd.Begin is made and when Bounds is set between calls to IBeginEnd.Begin and IBeginEnd.End. The following render state is reset:
-
The viewport and clip rectangle of the graphics context are set to Bounds, see IGraphicsContext.SetViewport and IGraphicsContext.SetClip.
-
The current transformation (see Transform) is set to AffineTransform.Identity, which clears the transformation stack (see PushTransform).
-
The line thickness is reset to one, see ILineThickness.LineThickness.