Documentation
¶
Overview ¶
Package three provides GopherJS bindings for the three.js project See http://threejs.org/
Index ¶
- type EventDispatcher
- type Face3
- type Faces
- type Geometry
- func (g *Geometry) ComputeBoundingSphere()
- func (g *Geometry) ComputeFaceNormals()
- func (g *Geometry) ElementsNeedUpdate() bool
- func (g *Geometry) Faces() *Faces
- func (g *Geometry) ID() int
- func (g *Geometry) Name() string
- func (g *Geometry) SetElementsNeedUpdate(value bool)
- func (g *Geometry) SetVerticesNeedUpdate(value bool)
- func (g *Geometry) Vertices() *Vertices
- func (g *Geometry) VerticesNeedUpdate() bool
- type HasMaterial
- type HasObject3D
- type Material
- type Mesh
- type MeshBasicMaterial
- type MeshBasicMaterialParams
- type MeshNormalMaterial
- type Object3D
- type Scene
- type Vector3
- type Vertices
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventDispatcher ¶
type EventDispatcher struct {
// contains filtered or unexported fields
}
EventDispatcher binds JavaScript events for custom objects. https://github.com/mrdoob/eventdispatcher.js
func (*EventDispatcher) JSObject ¶
func (e *EventDispatcher) JSObject() *js.Object
JSObject returns the underlying js.Object pointer for this object
type Face3 ¶
type Face3 struct {
// contains filtered or unexported fields
}
Face3 is a triangle face
func NewFace3 ¶
NewFace3 constructs a new Face3 object a — Vertex A index. b — Vertex B index. c — Vertex C index. normal — Face normal or array of vertex normals. color — Face color or array of vertex colors. materialIndex — Material index.
func NewFace3Normal ¶
NewFace3Normal constructs a new Face3 object with a face normal, color and material
type Faces ¶
type Faces struct {
// contains filtered or unexported fields
}
Faces is an array of Face3 objects
type Geometry ¶
type Geometry struct {
EventDispatcher
}
A Geometry holds all data necessary to describe a 3D model.
func NewGeometry ¶
func NewGeometry() *Geometry
NewGeometry creates a new Geometry object The constructor takes no arguments.
func (*Geometry) ComputeBoundingSphere ¶
func (g *Geometry) ComputeBoundingSphere()
ComputeBoundingSphere computes bounding sphere of the geometry, updating Geometry.boundingSphere attribute. Neither bounding boxes or bounding spheres are computed by default. They need to be explicitly computed, otherwise they are null.
func (*Geometry) ComputeFaceNormals ¶
func (g *Geometry) ComputeFaceNormals()
ComputeFaceNormals computes face normals.
func (*Geometry) ElementsNeedUpdate ¶
Set to true if the faces array has been updated.
func (*Geometry) Faces ¶
Faces describe how each vertex in the model is connected with each other. To signal an update in this array, Geometry.elementsNeedUpdate needs to be set to true.
func (*Geometry) SetElementsNeedUpdate ¶
func (*Geometry) SetVerticesNeedUpdate ¶
func (*Geometry) Vertices ¶
Vertices holds every position of points in the model. To signal an update in this array, Geometry.verticesNeedUpdate needs to be set to true.
func (*Geometry) VerticesNeedUpdate ¶
Set to true if the vertices array has been updated.
type HasMaterial ¶
type HasMaterial interface {
// contains filtered or unexported methods
}
HasMaterial identifies sub-types of Material
type HasObject3D ¶
type HasObject3D interface {
// contains filtered or unexported methods
}
HasObject3D marks subtypes of Object3D
type Material ¶
type Material struct {
EventDispatcher
}
A Material describes the appearance of objects. They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer.
type Mesh ¶
type Mesh struct {
Object3D
}
Mesh is a base class for Mesh objects, such as MorphAnimMesh and SkinnedMesh.
func NewMesh ¶
func NewMesh(geometry *Geometry, material HasMaterial) *Mesh
NewMesh constructs a new mesh object. geometry — An instance of Geometry. material — An instance of Material (optional).
type MeshBasicMaterial ¶
type MeshBasicMaterial struct {
Material
}
MeshBasicMaterial is a material for drawing geometries in a simple shaded (flat or wireframe) way. The default will render as flat polygons. To draw the mesh as wireframe, simply set the 'wireframe' property to true.
func NewMeshBasicMaterial ¶
func NewMeshBasicMaterial(params *MeshBasicMaterialParams) *MeshBasicMaterial
NewMeshBasicMaterial constructs a new MeshBasicMaterial
type MeshBasicMaterialParams ¶
type MeshBasicMaterialParams struct {
// contains filtered or unexported fields
}
MeshBasicMaterialParams is an object with one or more properties defining the material's appearance.
type MeshNormalMaterial ¶
type MeshNormalMaterial struct {
Material
}
MeshNormalMaterial is a material that maps the normal vectors to RGB colors.
func NewMeshNormalMaterial ¶
func NewMeshNormalMaterial() *MeshNormalMaterial
NewMeshNormalMaterial constructs a new MeshNormalMaterial
type Object3D ¶
type Object3D struct {
EventDispatcher
}
Object3D is the base class for scene graph objects.
func (*Object3D) Add ¶
func (o *Object3D) Add(object ...HasObject3D)
Add appends an object as child of this object. An arbitrary number of objects may be added. object - An object.
type Scene ¶
type Scene struct {
Object3D
}
A Scene allows you to set up what and where is to be rendered by three.js. This is where you place objects, lights and cameras.
type Vector3 ¶
type Vector3 struct {
// contains filtered or unexported fields
}
Vector3 is a 3 dimensional vector
func NewVector3 ¶
NewVector3 creates a new Vector3 x -- Float the vector's x value y -- Float the vector's y value z -- Float the vector's z value