Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Camera ¶
type Camera struct { d3.Pt Rot *d3.T // Angle of the lens relative to the Width. Angle angle.Rad Size grid.Pt }
Camera can be placed in a scene when rendering.
func (*Camera) Fullscreen ¶
Fullscreen aspect ratio and the provided width to set the size.
func (*Camera) SetRot ¶
SetRot on the camera from a transform generator. If the generator has a Normalize method, that will be called.
func (*Camera) Widescreen ¶
Widescreen aspect ratio and the provided width to set the size.
type CameraFactory ¶
CameraFactory produces a camera per frame.
type Frame ¶
Frame holds the camera to produce the frame and the meshes to render.
func (*Frame) AddMesh ¶
func (f *Frame) AddMesh(original *mesh.TriangleMesh, t *d3.T, shader interface{})
AddMesh to a sceneframe. The transform will be applied to all the points in the original mesh.
func (*Frame) TriangleCount ¶
TriangleCount is the total number of triangles in the frame.
type FrameMesh ¶
type FrameMesh struct { Original *mesh.TriangleMesh Shader interface{} Space []d3.Pt }
FrameMesh represents a mesh transformed for a specific frame. The Space slice holds the points of the mesh on the specific frame.
type Mesh ¶
type Mesh struct { Original *mesh.TriangleMesh TransformFactory Shader interface{} }
Mesh is used to generate a FrameMesh.
type Scene ¶
type Scene struct { CameraFactory Meshes []*Mesh FrameCount int ImgSize grid.Pt }
Scene is used to generate the camera and meshest for a sequence of frames. Size will populate the size on the camera if the CameraFactory does not set the size.
func NewScene ¶
func NewScene(camera CameraFactory, meshes int) *Scene
NewScene creates Scene and allocates the Mesh slice.
func (*Scene) AddMesh ¶
func (s *Scene) AddMesh(original *mesh.TriangleMesh, tf TransformFactory, shader interface{})
AddMesh appends a Mesh to the scene.
type TransformFactory ¶
TransformFactory produces a transform per frame index.
type TriangleIndex ¶
TriangleIndex provides an index to a specific triangle in a SceneFrame.