artofillusion
Class RenderingMesh

java.lang.Object
  extended by artofillusion.RenderingMesh
All Implemented Interfaces:
java.lang.Cloneable

public class RenderingMesh
extends java.lang.Object
implements java.lang.Cloneable

A RenderingMesh represents an object to be rendered to the screen. It is described by an array of RenderingTriangles, and arrays describing the positions, normals, and parameter values of the vertices. If any normal vector is null, then each triangle uses its own normal vector at the corresponding vertex.


Field Summary
 Vec3[] faceNorm
           
 TextureMapping mapping
           
 MaterialMapping matMapping
           
 Vec3[] norm
           
 ParameterValue[] param
           
 RenderingTriangle[] triangle
           
 Vec3[] vert
           
 
Constructor Summary
RenderingMesh(Vec3[] vert, Vec3[] norm, RenderingTriangle[] triangle, TextureMapping mapping, MaterialMapping matMapping)
          Construct a rendering mesh.
 
Method Summary
 RenderingMesh clone()
          Create a clone of this mesh.
 int[] getVertexIndices()
          This method is used to accelerate interactive rendering with OpenGL.
 void setParameters(ParameterValue[] param)
          Set the texture parameters for the mesh.
 void transformMesh(Mat4 trans)
          Apply a coordinate transformation to all of the vertices and normal vectors in this mesh.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vert

public Vec3[] vert

norm

public Vec3[] norm

faceNorm

public Vec3[] faceNorm

param

public ParameterValue[] param

triangle

public RenderingTriangle[] triangle

mapping

public TextureMapping mapping

matMapping

public MaterialMapping matMapping
Constructor Detail

RenderingMesh

public RenderingMesh(Vec3[] vert,
                     Vec3[] norm,
                     RenderingTriangle[] triangle,
                     TextureMapping mapping,
                     MaterialMapping matMapping)
Construct a rendering mesh.

Method Detail

clone

public RenderingMesh clone()
Create a clone of this mesh.

Overrides:
clone in class java.lang.Object

setParameters

public void setParameters(ParameterValue[] param)
Set the texture parameters for the mesh.


transformMesh

public void transformMesh(Mat4 trans)
Apply a coordinate transformation to all of the vertices and normal vectors in this mesh.


getVertexIndices

public int[] getVertexIndices()
This method is used to accelerate interactive rendering with OpenGL. If this mesh is fully smoothed (there is exactly one normal for every vertex), it returns an array containing the vertex indices for all the faces in a form suitable for passing to glDrawElements(). Otherwise, it returns null.



Copyright © 1999-2011 by Peter Eastman.