Example_Models

Description

static class Tinman.Demo.Examples.Example_Models

Full source code is included in the Tinman 3D SDK download.

This example contains some methods for construction 3D models.

Public / Methods

Build​Bounding​Cylinder​Gizmo


public static method BuildBoundingCylinderGizmo → (5)

origin in : Vec3D

The pick origin, usually the camera position.

ray in : Ray

The pick ray, in terrain-space.

transform in : AffineTransform

The transformation from model-space to terrain-space.

model in : IModel

[not-null]
The model for which to a picked bounding cylinder.

pose in : ModelPose

The model pose or null.

returns → IModel

The built model.

Builds a 3D gizmo for a picked bounding cylinder.

The gizmo contains three parts:

Build​Cylinder


public static method BuildCylinder → (4)

parent in : Model

[not-null]
The parent model to which to add the cylinder model.

ray in : Ray

The ray to use as the cylinder spine.

range in : RangeD

The ray distance range of the cylinder.

radius in : float64

[>=0]
The cylinder radius.

Builds a transparent cylinder model along the given ray in distance range in and radius in.

Build​Point​Soup​From​Model​Vertices


public static method BuildPointSoupFromModelVertices → (5)

parent in : Model

[not-null]
The parent model to which to add the point soup model.

model in : IModel

[not-null]
The model for which to build the point soup.

pose in : ModelPose

The model pose to use or null.

transform in : AffineTransform

The transformation from model-space to terrain-space.

color opt : int64 = Colors.Red

The point color to use for the soup.

Builds a point soup for the vertices of the given model in.

Build​Ray​With​Two​Segments


public static method BuildRayWithTwoSegments → (7)

parent in : Model

[not-null]
The parent model to which to add the line segment model.

ray in : Ray

The ray along which to build the line segment model.

range in : RangeD

The ray distance of the line segment.

delimiter in : float64

The delimiter ray distance that splits the line segment into two parts.

colorFirst opt : int64 = Colors.Green

Color of the first line segment part.

colorSecond opt : int64 = Colors.Red

Color of the second line segment part.

thickness opt : float32 = 3

The line segment thickness, in pixels.

Builds a thick line segment on the given ray in along the specified ray distance range in, splitting it into a first and a second part at the delimiter in ray distance and using the given colors for the two parts.