vtMeshBase Class Reference
[Scene Graph]

Inheritance diagram for vtMeshBase:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void GetBoundBox (FBox3 &box) const
int AddVertex (float x, float y, float z)
int AddVertexN (float x, float y, float z, float nx, float ny, float nz)
int AddVertexUV (float x, float y, float z, float u, float v)
int AddVertex (const FPoint3 &p)
int AddVertexN (const FPoint3 &p, const FPoint3 &n)
int AddVertexUV (const FPoint3 &p, float u, float v)
int AddVertexUV (const FPoint3 &p, const FPoint2 &uv)
int AddVertexNUV (const FPoint3 &p, const FPoint3 &n, const FPoint2 &uv)
void AddStrip2 (int iNVerts, int iStartIndex)
void TransformVertices (const FMatrix4 &mat)
void CreateEllipsoid (const FPoint3 &center, const FPoint3 &size, int res, bool hemi=false, bool bNormalsIn=false)
void CreateBlock (const FPoint3 &size)
void CreateOptimizedBlock (const FPoint3 &size)
void CreatePrism (const FPoint3 &base, const FPoint3 &vector_up, const FPoint2 &size1, const FPoint2 &size2)
void CreateRectangularMesh (int xsize, int ysize, bool bReverseNormals=false)
void CreateCylinder (float height, float radius, int res, bool bTop=true, bool bBottom=true, bool bCentered=true, int direction=1)
void AddRectangleXZ (float xsize, float zsize)
void AddRectangleXY (float x, float y, float xsize, float ysize, float z=0.0f, bool bCentered=false)
void CreateConicalSurface (const FPoint3 &tip, double radial_angle, double theta1, double theta2, double r1, double r2, int res=40)
void CreateRectangle (int iQuads1, int iQuads2, int Axis1, int Axis2, int Axis3, const FPoint2 &min1, const FPoint2 &max1, float fLevel, float fTiling)


Detailed Description

This class provides basic methods for the vtMesh class.

Member Function Documentation

void vtMeshBase::AddRectangleXY ( float  x,
float  y,
float  xsize,
float  ysize,
float  z = 0.0f,
bool  bCentered = false 
)

Adds the vertices and a fan primitive for a single flat rectangle.

void vtMeshBase::AddRectangleXZ ( float  xsize,
float  zsize 
)

Adds the vertices and a fan primitive for a single flat rectangle.

void vtMeshBase::AddStrip2 ( int  iNVerts,
int  iStartIndex 
)

Adds an indexed strip to the mesh, with the assumption that the indices are in linear order.

Parameters:
iNVerts The number of vertices in the strip.
iStartIndex The index that starts the linear sequence.

int vtMeshBase::AddVertex ( const FPoint3 p  ) 

Adds a vertex to the mesh.

Returns:
The index of the vertex that was added.

int vtMeshBase::AddVertex ( float  x,
float  y,
float  z 
)

Adds a vertex to the mesh.

Returns:
The index of the vertex that was added.

int vtMeshBase::AddVertexN ( const FPoint3 p,
const FPoint3 n 
)

Adds a vertex to the mesh, with a vertex normal.

Returns:
The index of the vertex that was added.

int vtMeshBase::AddVertexN ( float  x,
float  y,
float  z,
float  nx,
float  ny,
float  nz 
)

Adds a vertex to the mesh, with a vertex normal.

Returns:
The index of the vertex that was added.

int vtMeshBase::AddVertexNUV ( const FPoint3 p,
const FPoint3 n,
const FPoint2 uv 
)

Adds a vertex to the mesh, with a vertex normal and UV coordinates.

Returns:
The index of the vertex that was added.

int vtMeshBase::AddVertexUV ( const FPoint3 p,
const FPoint2 uv 
)

Adds a vertex to the mesh, with UV coordinates.

Returns:
The index of the vertex that was added.

int vtMeshBase::AddVertexUV ( const FPoint3 p,
float  u,
float  v 
)

Adds a vertex to the mesh, with UV coordinates.

Returns:
The index of the vertex that was added.

int vtMeshBase::AddVertexUV ( float  x,
float  y,
float  z,
float  u,
float  v 
)

Adds a vertex to the mesh, with UV coordinates.

Returns:
The index of the vertex that was added.

void vtMeshBase::CreateBlock ( const FPoint3 size  ) 

Add a block (rectangular 3d box) to this mesh. The width, height and depth are specified with the 'size' parameter.

void vtMeshBase::CreateConicalSurface ( const FPoint3 tip,
double  radial_angle,
double  theta1,
double  theta2,
double  r1,
double  r2,
int  res = 40 
)

Adds an conical surface to this mesh. This is a subset of a full cone, bounded by start/end factors along the two degrees of freedom of the surface of the cone. The default orientation of the cone is with the tip pointing up (radius increasing downward).

Parameters:
tip The top point of the cone.
radial_angle This is the angle between the cone's edge and its center axis, in radians. Expected range is 0 to PI/2. Small values indicate a sharp, pointed cone, large values indicate a blunt cone. The slope of the cone's edge is tan(radial_angle).
theta1,theta2 Start and end values for the theta value, which ranges from 0 to 2*PI around the central axis of the cone.
r1,r2 Start and end values for the cone's radius. These range from 0 (at the tip of the cone) and increase downward.
res Resolution, number of polygons along each side of the surface mesh.

void vtMeshBase::CreateCylinder ( float  height,
float  radius,
int  res,
bool  bTop = true,
bool  bBottom = true,
bool  bCentered = true,
int  direction = 1 
)

Adds an cylinder to this mesh.

Parameters:
height The height of the cylinder.
radius The radius of the cylinder.
res The resolution (number of side of the cylinder).
bTop True to create the top of the cylinder.
bBottom True to create the bottom of the cylinder. You could set this to false, for example, if the cylinder is going to sit on a flat surface where you will never see its bottom.
bCentered True to create a cylinder centered around its origin, false for a cylinder with its base at the origin that extends outward.
direction An orientation, 0-2 corresponds to X, Y, Z. Default is 1 (Y).

void vtMeshBase::CreateEllipsoid ( const FPoint3 center,
const FPoint3 size,
int  res,
bool  hemi = false,
bool  bNormalsIn = false 
)

Adds geometry for an ellipsoid to this mesh.

The geometry is created with efficient triangle strips. If the mesh has vertex normals, outward-pointing normals are created for lighting. If the mesh has vertex coordinates, then UVs are set as follows: U ranges from 0 to 1 around the circumference, and V ranges from 0 to 1 from the top to the bottom. For a hemisphere, V ranges from 0 at the top to 1 at the base.

Parameters:
center Position of the center, pass FPoint3(0,0,0) to center on the origin.
size The width, height and depth of the ellipsoid.
res The resolution (number of quads used in the tesselation) from top to bottom (north pole to south pole).
hemi Create only the top of the ellipsoid (e.g. a hemisphere).
bNormalsIn Use a vertex order in the mesh so that the normals point in, instead of out. This is useful for, example, a backface-culled sphere that you want to see from the inside, instead of the outside.

void vtMeshBase::CreateOptimizedBlock ( const FPoint3 size  ) 

Adds a 3D block to a vtMesh as a series of 5 triangle fan primitives. The bottom face is omitted, the base is placed at y=0, and texture coordinates are provided such that texture bitmaps appear right-side-up on the side faces.

void vtMeshBase::CreatePrism ( const FPoint3 base,
const FPoint3 vector_up,
const FPoint2 size1,
const FPoint2 size2 
)

Adds a 3D block (extruded rectangle) to a vtMesh as a series of 5 triangle fan primitives. The bottom face is omitted, the base is placed at /base/, the extrusion is along /vector_up/. Texture coordinates are provided such that texture bitmaps appear right-side-up on the side faces.

void vtMeshBase::CreateRectangle ( int  iQuads1,
int  iQuads2,
int  Axis1,
int  Axis2,
int  Axis3,
const FPoint2 min1,
const FPoint2 max1,
float  fLevel,
float  fTiling 
)

Adds an rectangular surface to this mesh. The rectangle will lie in the first two axes given, facing toward the third. Axes can be specified by number. For example, to produce a rectangle in the XZ plane facing along the Y axis, you would pass 0, 2, 1.

Parameters:
iQuads1 The number of quads along the first axis.
iQuads2 The number of quads along the second axis.
Axis1 The first axis (X=0, Y=1, Z=2)
Axis2 The second axis (X=0, Y=1, Z=2)
Axis3 The third axis (X=0, Y=1, Z=2)
min1 The lower-left-hand corner of the rectangle's position
max1 The size of the rectangle.
fLevel The value of the rectangle on the third axis.
fTiling UV tiling. Set to 1 for UV coordinate of O..1.

void vtMeshBase::CreateRectangularMesh ( int  xsize,
int  ysize,
bool  bReverseNormals = false 
)

Adds triangle/quad strips to this mesh, suitable for a (topologically) rectangular grid.

Parameters:
xsize Number of vertices in the first dimension.
ysize Number of vertices in the second dimension.
bReverseNormals Reverse the vertex order so the normals point the other way.

void vtMeshBase::GetBoundBox ( FBox3 box  )  const [virtual]

Computes the bounding box of the mesh, based on the extent of its vertices. Result is placed in the 'box' parameter. If there are no vertices, then 'box' is unchanged.

Reimplemented in vtMesh.

void vtMeshBase::TransformVertices ( const FMatrix4 mat  ) 

Transform all the vertices of the mesh by the indicated matrix.


Generated on Wed Dec 24 13:08:43 2008 for vtlib library by  doxygen 1.5.7.1