void

Description

Mesh builders can be used to create meshes.

Namespaces

   
namespace Rendering::MeshUtils::MarchingCubesMeshBuilder
namespace Rendering::MeshUtils::PlatonicSolids
namespace Rendering::MeshUtils::WireShapes

Classes

   
class Rendering::MeshUtils::MeshBuilder
class Rendering::MeshUtils::QuadtreeMeshBuilder

Functions

   
   
Mesh * createBox(const VertexDescription & vd, const Geometry::Box & box)
   
void addBox(MeshBuilder & mb, const Geometry::Box & box)
Adds a box to the given meshBuilder.
   
Mesh * createDome(const VertexDescription & vd, const double radius, const int horiRes, const int vertRes, const double halfSphereFraction, const double imagePercentage)
   
void addDome(MeshBuilder & mb, const double radius, const int horiRes, const int vertRes, const double halfSphereFraction, const double imagePercentage)
Adds a dome to the given meshBuilder.
   
Mesh * createSphere(const VertexDescription & vd, const Geometry::Sphere_f & sphere, uint32_t inclinationSegments, uint32_t azimuthSegments)
   
void addSphere(MeshBuilder & mb, const Geometry::Sphere_f & sphere, uint32_t inclinationSegments, uint32_t azimuthSegments)
Adds a shere to the given meshBuilder.
   
Mesh * createDiscSector(const VertexDescription & vd, float radius, uint8_t numSegments, float angle)
   
void addDiscSector(MeshBuilder & mb, float radius, uint8_t numSegments, float angle)
Adds a disc sector to the given meshBuilder.
   
Mesh * createRingSector(const VertexDescription & vd, float innerRadius, float outerRadius, uint8_t numSegments, float angle)
   
void addRingSector(MeshBuilder & mb, float innerRadius, float outerRadius, uint8_t numSegments, float angle)
Adds a ring sector to the given meshBuilder.
   
Mesh * createCone(const VertexDescription & vd, float radius, float height, uint8_t numSegments)
   
void addCone(MeshBuilder & mb, float radius, float height, uint8_t numSegments)
Adds a cone to the given meshBuilder.
   
Mesh * createConicalFrustum(const VertexDescription & vd, float radiusBottom, float radiusTop, float height, uint8_t numSegments)
   
void addConicalFrustum(MeshBuilder & mb, float radiusBottom, float radiusTop, float height, uint8_t numSegments)
Adds a conical frustum to the given meshBuilder.
   
Mesh * createArrow(const VertexDescription & vd, float radius, float length)
   
void addArrow(MeshBuilder & mb, float radius, float length)
Adds an arrow to the given meshBuilder.
   
Mesh * createRectangle(const VertexDescription & vd, const Geometry::Rect_f & rect)
   
Mesh * createRectangle(const VertexDescription & vd, float width, float height)
   
void addRectangle(MeshBuilder & mb, const Geometry::Rect_f & rect)
Adds an rectangle to the given meshBuilder.
   
void addRectangle(MeshBuilder & mb, float width, float height)
Adds an rectangle to the given meshBuilder.
   
Mesh * createGrid(const VertexDescription & vd, float width, float height, uint32_t rows, uint32_t columns)
   
void addGrid(MeshBuilder & mb, float width, float height, uint32_t rows, uint32_t columns)
Adds a rectangular grid to the given meshBuilder.
   
Mesh * createHexGrid(const VertexDescription & vd, float width, float height, uint32_t rows, uint32_t columns)
   
void addHexGrid(MeshBuilder & mb, float width, float height, uint32_t rows, uint32_t columns)
Adds a hexagonal grid to the given meshBuilder.
   
Mesh * createVoxelMesh(const VertexDescription & vd, const Util::PixelAccessor & colorAcc, uint32_t depth)
   
void addVoxelMesh(MeshBuilder & mb, const Util::PixelAccessor & colorAcc, uint32_t depth)
Adds a voxel mesh to the given meshBuilder.
   
Mesh * createTorus(const VertexDescription & vd, float innerRadius, float outerRadius, uint32_t majorSegments, uint32_t minorSegments)
   
void addTorus(MeshBuilder & mb, float innerRadius, float outerRadius, uint32_t majorSegments, uint32_t minorSegments)
Adds a torus to the MeshBuilder .
   
Mesh * createMeshFromBitmaps(const VertexDescription & vd, Util::Reference < Util::PixelAccessor > depth, Util::Reference < Util::PixelAccessor > color, Util::Reference < Util::PixelAccessor > normals)
   
void addMeshFromBitmaps(MeshBuilder & mb, Util::Reference < Util::PixelAccessor > depth, Util::Reference < Util::PixelAccessor > color, Util::Reference < Util::PixelAccessor > normals)
Adds a mesh from bitmap to the given meshBuilder.

Documentation

function
createBox

public
     
     
Mesh * createBox( const VertexDescription & vd,
  const Geometry::Box & box
)    

Return the mesh of a three-dimensional, axis-aligned box. Positions, and normals are supported.

Parameters

vd
Vertex description specifying the vertex information to generate
box
Geometric specification of the box

Returns

Mesh of the box

Defined in Rendering/MeshUtils/PrimitiveShapes.h:62


function
addBox

public
     
     
void addBox( MeshBuilder & mb,
  const Geometry::Box & box
)    

Adds a box to the given meshBuilder.

See also: createBox (…)

Defined in Rendering/MeshUtils/PrimitiveShapes.h:65


function
createDome

public
     
     
Mesh * createDome( const VertexDescription & vd,
  const double radius,
  const int horiRes,
  const int vertRes,
  const double halfSphereFraction,
  const double imagePercentage
)    

Creates a mesh for a sky dome with texture coordinates.

Note: adapted from [alc]http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=13887&sid=25788d2b93c73294fd7abe76db6fab1e

Defined in Rendering/MeshUtils/PrimitiveShapes.h:69


function
addDome

public
     
     
void addDome( MeshBuilder & mb,
  const double radius,
  const int horiRes,
  const int vertRes,
  const double halfSphereFraction,
  const double imagePercentage
)    

Adds a dome to the given meshBuilder.

See also: createDome (…)

Defined in Rendering/MeshUtils/PrimitiveShapes.h:72


function
createSphere

public
     
     
Mesh * createSphere( const VertexDescription & vd,
  const Geometry::Sphere_f & sphere,
  uint32_t inclinationSegments,
  uint32_t azimuthSegments
)    

Return a sphere, which is generated by subdividing the sphere surface into segements. The surface is subdivided into the given number of subdivisions of the inclination angle and the azimuth angle, respectively. The sphere is centered at the origin and the vertices are lying on the unit sphere. The given vertex description specifies which information is generated for every vertex. Positions, normals, colors, and texture coordinates are supported.

Parameters

vd
Vertex description specifying the vertex information to generate
inclinationSegments
Number of subdivisions of the inclination angle
azimuthSegments
Number of subdivisions of the azimuth angle

Returns

Sphere Mesh

Defined in Rendering/MeshUtils/PrimitiveShapes.h:87


function
addSphere

public
     
     
void addSphere( MeshBuilder & mb,
  const Geometry::Sphere_f & sphere,
  uint32_t inclinationSegments,
  uint32_t azimuthSegments
)    

Adds a shere to the given meshBuilder.

See also: createSphere (…)

Defined in Rendering/MeshUtils/PrimitiveShapes.h:90


function
createDiscSector

public
     
     
Mesh * createDiscSector( const VertexDescription & vd,
  float radius,
  uint8_t numSegments,
  float angle
)    

Return a sector of a disc. The center of the disc is the origin. The disc is aligned with the y-z plane and the normals are pointing into negative x direction. Positions and normals for the vertices are generated.

Parameters

vd
Vertex description specifying the vertex information to generate
radius
Radius of the disc
numSegments
Number of segments for the disc
angle
Central angle of the sector in degrees

Returns

Disc Mesh ornullptrif the number of segments is smaller than two.

Defined in Rendering/MeshUtils/PrimitiveShapes.h:104


function
addDiscSector

public
     
     
void addDiscSector( MeshBuilder & mb,
  float radius,
  uint8_t numSegments,
  float angle
)    

Adds a disc sector to the given meshBuilder.

See also: createDiscSector (…)

Defined in Rendering/MeshUtils/PrimitiveShapes.h:107


function
createRingSector

public
     
     
Mesh * createRingSector( const VertexDescription & vd,
  float innerRadius,
  float outerRadius,
  uint8_t numSegments,
  float angle
)    

Return a sector of a ring. The center of the disc is the origin. The disc is aligned with the y-z plane and the normals are pointing into negative x direction. Positions and normals for the vertices are generated.

Parameters

vd
Vertex description specifying the vertex information to generate
innerRadius
inner radius of the ring
outerRadius
outer radius of the ring
numSegments
Number of segments for the disc
angle
Central angle of the sector in degrees

Returns

Disc Mesh ornullptrif the number of segments is smaller than two or innerRadius >= outerRadius

Defined in Rendering/MeshUtils/PrimitiveShapes.h:122


function
addRingSector

public
     
     
void addRingSector( MeshBuilder & mb,
  float innerRadius,
  float outerRadius,
  uint8_t numSegments,
  float angle
)    

Adds a ring sector to the given meshBuilder.

See also: createRingSector (…)

Defined in Rendering/MeshUtils/PrimitiveShapes.h:125


function
createCone

public
     
     
Mesh * createCone( const VertexDescription & vd,
  float radius,
  float height,
  uint8_t numSegments
)    

Return a cone with the radius given. The cap end is not created. The center of the base is the origin. The apex lies on the x-axis at distanceheightfrom the origin. Positions and normals for the vertices are generated.

Parameters

vd
Vertex description specifying the vertex information to generate
radius
Radius of the base
height
Distance between the base and the apex
numSegments
Number of segments for the circle at the base and the lateral surface

Returns

Cone Mesh ornullptrif the number of segments is smaller than two

See also: createDisc() for creation of a cap end

Defined in Rendering/MeshUtils/PrimitiveShapes.h:141


function
addCone

public
     
     
void addCone( MeshBuilder & mb,
  float radius,
  float height,
  uint8_t numSegments
)    

Adds a cone to the given meshBuilder.

See also: createCone (…)

Defined in Rendering/MeshUtils/PrimitiveShapes.h:144


function
createConicalFrustum

public
     
     
Mesh * createConicalFrustum( const VertexDescription & vd,
  float radiusBottom,
  float radiusTop,
  float height,
  uint8_t numSegments
)    

Return a conical frustum with the radii given. The cap ends are not created. The center of the bottom circle is the origin. The center of the top circle lies on the x-axis at distanceheightfrom the origin. If both radii have the same value, a cylinder is created. Positions and normals for the vertices are generated.

Parameters

vd
Vertex description specifying the vertex information to generate
radiusBottom
Radius of the bottom circle
radiusTop
Radius of the top circle
height
Distance between both circles
numSegments
Number of segments for the circles and the lateral surface

Returns

Conical frustum Mesh ornullptrif the number of segments is smaller than two

See also: createDisc() for creation of cap ends

Defined in Rendering/MeshUtils/PrimitiveShapes.h:162


function
addConicalFrustum

public
     
     
void addConicalFrustum( MeshBuilder & mb,
  float radiusBottom,
  float radiusTop,
  float height,
  uint8_t numSegments
)    

Adds a conical frustum to the given meshBuilder.

See also: createConicalFrustum (…)

Defined in Rendering/MeshUtils/PrimitiveShapes.h:165


function
createArrow

public
     
     
Mesh * createArrow( const VertexDescription & vd,
  float radius,
  float length
)    

Returns an arrow which consists of a ConicalFrustum and 2 Cones at one end.

Parameters

vd
Vertex description specifying the vertex information to generate
radius
Radius of the arrow
length
Overall length of the arrow

Returns

Arrow Mesh

Defined in Rendering/MeshUtils/PrimitiveShapes.h:175


function
addArrow

public
     
     
void addArrow( MeshBuilder & mb,
  float radius,
  float length
)    

Adds an arrow to the given meshBuilder.

See also: createArrow (…)

Defined in Rendering/MeshUtils/PrimitiveShapes.h:178


function
createRectangle

public
     
     
Mesh * createRectangle( const VertexDescription & vd,
  const Geometry::Rect_f & rect
)    

Returns a Rectangle consisting of 2 triangles (oriented in x-y-plane)

Parameters

vd
Vertex description specifying the vertex information to generate
rect
the rectangle

Returns

Rectangle Mesh

Defined in Rendering/MeshUtils/PrimitiveShapes.h:187


function
createRectangle

public inline
     
     
Mesh * createRectangle( const VertexDescription & vd,
  float width,
  float height
)    

Returns a Rectangle consisting of 2 triangles with origin in the center (oriented in x-y-plane)

Parameters

vd
Vertex description specifying the vertex information to generate
width
The width of the rectangle
height
The height of the rectangle

Returns

Rectangle Mesh

Defined in Rendering/MeshUtils/PrimitiveShapes.h:197


function
addRectangle

public
     
     
void addRectangle( MeshBuilder & mb,
  const Geometry::Rect_f & rect
)    

Adds an rectangle to the given meshBuilder.

See also: createRectangle (…)

Defined in Rendering/MeshUtils/PrimitiveShapes.h:202


function
addRectangle

public inline
     
     
void addRectangle( MeshBuilder & mb,
  float width,
  float height
)    

Adds an rectangle to the given meshBuilder.

See also: createRectangle (…)

Defined in Rendering/MeshUtils/PrimitiveShapes.h:204


function
createGrid

public
     
     
Mesh * createGrid( const VertexDescription & vd,
  float width,
  float height,
  uint32_t rows,
  uint32_t columns
)    

Creates a rectangular grid in the x-z-plane.

Parameters

vd
Vertex description specifying the vertex information to generate
width
The width of the grid
height
The height of the grid
rows
number of rows
columns
number of columns

Defined in Rendering/MeshUtils/PrimitiveShapes.h:217


function
addGrid

public
     
     
void addGrid( MeshBuilder & mb,
  float width,
  float height,
  uint32_t rows,
  uint32_t columns
)    

Adds a rectangular grid to the given meshBuilder.

See also: createGrid (…)

Defined in Rendering/MeshUtils/PrimitiveShapes.h:220


function
createHexGrid

public
     
     
Mesh * createHexGrid( const VertexDescription & vd,
  float width,
  float height,
  uint32_t rows,
  uint32_t columns
)    

Creates a hexagonal grid in the x-z-plane.

Parameters

vd
Vertex description specifying the vertex information to generate
width
The width of the grid
height
The height of the grid
rows
number of rows. Needs to be at least 3
columns
number of columns. Needs to be at least 4

Defined in Rendering/MeshUtils/PrimitiveShapes.h:231


function
addHexGrid

public
     
     
void addHexGrid( MeshBuilder & mb,
  float width,
  float height,
  uint32_t rows,
  uint32_t columns
)    

Adds a hexagonal grid to the given meshBuilder.

See also: createHexGrid (…)

Defined in Rendering/MeshUtils/PrimitiveShapes.h:234


function
createVoxelMesh

public
     
     
Mesh * createVoxelMesh( const VertexDescription & vd,
  const Util::PixelAccessor & colorAcc,
  uint32_t depth
)    

Creates a mesh from a voxel bitmap as exported from a 3D Texture . The bitmap should have a height of depth*heiht, i.e., each depth layer is stored from top to bottom in the vertical direction of the bitmap. The height and width of the voxel grid is derived from the bitmap width and height. The actual height of the voxel grid is bitmap-height/depth. A voxel box of size 1^3 is created for every pixel with a positive alpha value. The local point (0,0,0) in the resulting mesh corresponds to the (0,0,0) coordinate in the voxel bitmap. To scale the mesh afterwards, use MeshUtils::transform

Parameters

vd
Vertex description specifying the vertex information to generate
colorAcc
the bitmap that defines the voxel grid. Every pixel with non-zero alpha value defines a voxel.
the
depth of the voxel grid. The height of the bitmap should be divisible by this value

Defined in Rendering/MeshUtils/PrimitiveShapes.h:248


function
addVoxelMesh

public
     
     
void addVoxelMesh( MeshBuilder & mb,
  const Util::PixelAccessor & colorAcc,
  uint32_t depth
)    

Adds a voxel mesh to the given meshBuilder.

See also: createHexGrid (…)

Defined in Rendering/MeshUtils/PrimitiveShapes.h:251


function
createTorus

public
     
     
Mesh * createTorus( const VertexDescription & vd,
  float innerRadius,
  float outerRadius,
  uint32_t majorSegments,
  uint32_t minorSegments
)    

Creates a torus mesh. The center of the torus is located at the origin. The aligned is aligned with the x-z plane.

Parameters

vd
Vertex description specifying the vertex information to generate
innerRadius
inner radius of the torus. Should be greater than or equal 0.
outerRadius
outer radius of the torus. Should be greater than inner radius.
majorSegments
Number of major segments. Minimum is 3.
minorSegments
Number of minor segments. Minimum is 3.

Returns

The mesh

Defined in Rendering/MeshUtils/PrimitiveShapes.h:265


function
addTorus

public
     
     
void addTorus( MeshBuilder & mb,
  float innerRadius,
  float outerRadius,
  uint32_t majorSegments,
  uint32_t minorSegments
)    

Adds a torus to the MeshBuilder .

See also: addTorus (…)

Defined in Rendering/MeshUtils/PrimitiveShapes.h:268


function
createMeshFromBitmaps

public
     
     
Mesh * createMeshFromBitmaps( const VertexDescription & vd,
  Util::Reference < Util::PixelAccessor > depth,
  Util::Reference < Util::PixelAccessor > color,
  Util::Reference < Util::PixelAccessor > normals
)    

Creates a mesh from the input bitmap.

Parameters

vd
Vertex description specifying the vertex information to generate
depth
Bitmap with depth values. Translates to the y-values of the mesh.
color
Bitmap with colors.
normals
Bitmap with normals.

Returns

The mesh

Defined in Rendering/MeshUtils/PrimitiveShapes.h:280


function
addMeshFromBitmaps

public
     
     
void addMeshFromBitmaps( MeshBuilder & mb,
  Util::Reference < Util::PixelAccessor > depth,
  Util::Reference < Util::PixelAccessor > color,
  Util::Reference < Util::PixelAccessor > normals
)    

Adds a mesh from bitmap to the given meshBuilder.

See also: createMeshFromBitmaps (…)

Defined in Rendering/MeshUtils/PrimitiveShapes.h:283