Most visited

Recently visited

Geometry

public class Geometry
extends Object

java.lang.Object
   ↳ com.viro.core.Geometry
Known Direct Subclasses
Box Box is a simple shape representing a six-sided geometry, defined by width, height, and length. 
Polygon Polygon represents a one-sided plane whose boundary is defined by a list of vertices. 
Polyline Polyline defines a multi-point line. 
Quad Quad represents a one-sided plane defined by a width and height. 
Sphere Sphere defines a spherical shape, e.g. 
Surface This class is deprecated. Use Quad in place of this class.  
Text Text is a Geometry that renders strings of text. 


Geometry is the top-level class for any displayable 3D model with Material objects that define its appearance. Geometry objects can be simple shapes (e.g. Box or Sphere), full 3D models (e.g. Object3D), or UI components (e.g. Text).

Summary

Nested classes

class Geometry.GeometryBuilder

Builder for creating Geometry objects. 

Public constructors

Geometry()

Construct a new Geometry.

Public methods

static Geometry.GeometryBuilder geometryBuilder()

Retrieve a builder for creating Geometry objects.

List<Material> getMaterials()

Get the Material objects used by this Geometry.

List<Submesh> getSubmeshes()

Get the Submeshes used by this Geometry.

void setMaterials(List<Material> materials)

Set the Material objects that define the Geometry's appearance.

void setNormals(List<Vector> normals)

Set the normal vectors used by this Geometry.

void setSubmeshes(List<Submesh> submeshes)

Set the Submeshes for this Geometry.

void setTextureCoordinates(List<Vector> textureCoordinates)

Set the texture coordinates used by this Geometry.

void setVertices(List<Vector> vertices)

Set the vertices of this Geometry.

Public constructors

Geometry

Geometry ()

Construct a new Geometry.

Public methods

geometryBuilder

Geometry.GeometryBuilder geometryBuilder ()

Retrieve a builder for creating Geometry objects.

Returns
Geometry.GeometryBuilder

getMaterials

List<Material> getMaterials ()

Get the Material objects used by this Geometry.

Returns
List<Material> List containing each Material used by this Geometry.

getSubmeshes

List<Submesh> getSubmeshes ()

Get the Submeshes used by this Geometry. Submeshes define how to connect the vertices in this Geometry to form a 3D object.

Returns
List<Submesh>

setMaterials

void setMaterials (List<Material> materials)

Set the Material objects that define the Geometry's appearance.

Materials consist of a variety of visual properties, including colors and textures, that define how the Geometry interacts with the Lights in a Scene to render each pixel.

Geometries may contain multiple Materials; how those Materials map to the surfaces of a Geometry is determined by each individual Geometry.

Parameters
materials List: The list of Materials to use for this Geometry.

setNormals

void setNormals (List<Vector> normals)

Set the normal vectors used by this Geometry. Normal vectors define the orientation of the surfaces of this Geometry, which determines how each surface responds to light and other environmental factors. Like vertices and texture coordinates, normals are grouped into triangles by the Submeshes. When rendering a triangle, the normal at each point is interpolated from the normals defined by each vertex of the triangle.

Parameters
normals List: The normal vectors to use for this Geometry.

setSubmeshes

void setSubmeshes (List<Submesh> submeshes)

Set the Submeshes for this Geometry. Submeshes define how to connect the vertices in this Geometry to form a 3D object. Each Submesh contains a triangle definition that indicates how to join the Geometry's vertices into a set of triangles that will form the surfaces of this model.

Submeshes are also tied to Materials: Submesh i uses Material i. If there are fewer materials than submeshes, then Submesh i will use Material i % materials.size().

Parameters
submeshes List: The Submeshes that will define the surfaces of this Geometry.

setTextureCoordinates

void setTextureCoordinates (List<Vector> textureCoordinates)

Set the texture coordinates used by this Geometry. Texture coordinates define how the 2D textures used by the Geometry are mapped onto its 3D surfaces. Like vertices, texture coordinates are grouped together by triangles. The grouping into triangles is defined by the Submeshes.

Parameters
textureCoordinates List: The texture coordinates used by this Geometry. Each Vector uses X for the texture U coordinate, and the Y for the texture V coordinate. The Z coordinate is ignored.

setVertices

void setVertices (List<Vector> vertices)

Set the vertices of this Geometry. The vertices define the physical shape of the Geometry: each is an X, Y, Z coordinate. Vertices are grouped together to form triangles, which together create the surface of the Geometry. The grouping together of the vertices into triangles is defined by the Submeshes.

Parameters
vertices List: The vertices to use for this Geometry.

Hooray!