Example_SceneApi

Description

static class Tinman.Demo.Examples.Code.Example_SceneApi

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

This example contains some useful helpers for dealing with the Scene API.

These are the primary entry points of this example:

Public / Methods

Build​Fire​Effect


[OwnerReturn] [Pure]
public static method BuildFireEffect → (2)

source in : Example_ParticleSource

[not-null]
The fire effect particle source.

entityViewMask in : int64

The value for IEntityViewMask.EntityViewMask.

returns → ParticleEffect

The created particle effect.

Creates an example particle effect for fire, smoke and explosions.

Build​Heightmap​Shape


[Pure]
public static method BuildHeightmapShape → (3)

shape in : IShape

[not-null]
The shape.

range in : VerticalRange

The vertical range of the target heightmap.

falloff in : float64

The shape distance falloff value.

returns → HeightmapShape

The built heightmap correction shape.

Builds a HeightmapShape for the given shape in.

The ShapeValue.Vertical values of the shape in vertices are interpreted a ellipsoid height.

Build​Shape​From​Geocentric​Box


public static method BuildShapeFromGeocentricBox → (5)

scene in : IScene

[not-null]
The scene to use.

box in : Box3D

The box in the local coordinate system, which uses the same length unit as the scene in.

falloff in : float64

The shape distance falloff to use.

offset in : float64

The surface offset to tolerate, see ComputeCurvatureOffset.

terrain in : AffineTransform

The transformation from the local coordinate system to the geocentric coordinate system of the scene (see IScene.Geocentric).

returns → HeightmapShape

The built heightmap correction shape.

Builds a HeightmapShape for adding a terrain correction via IScene.Correction, based on the given box in a local coordinate system.

Using a shape in a projected coordinate system will adjust the terrain along the surface of the reference ellipsoid. This method adjusts the terrain along a box in the geocentric coordinate system, which is usually necessary when static 3D terrain models are used in the scene.

Camera​Look​At


public static method CameraLookAt → (2)

sceneView in : SceneView

The scene view whose camera to update.

coordinates in : LatLonHeight

The geographic coordinates to look at.

Points the camera of the given SceneView to the given geographic coordinates in.

Compute​Curvature​Offset


[Pure]
public static method ComputeCurvatureOffset → (2)

radius in : float64

The sphere radius.

distance in : float64

The distance between the points on the sphere surface.

returns → float64

The maximum distance.

Given two points on a sphere that have the specified distance in, computes the maximum distance between the line segment that connects both points and the surface of the sphere.

Compute​Curvature​Offset​Inv


[Pure]
public static method ComputeCurvatureOffsetInv → (2)

radius in : float64

The sphere radius.

offset in : float64

The maximum distance.

returns → float64

The distance between the points on the sphere surface.

Performs the inverse computation of ComputeCurvatureOffset.

Transform​Point​To​Map​With​Height


[Pure]
public static method TransformPointToMapWithHeight → (4)

point in : Vec3D

The point to transform, in the local coordinate system, which is assumed to use the same length unit as geocentric in.

terrain in : AffineTransform

The transformation from the local coordinate system to the coordinate system of geocentric in.

geocentric in : Geocentric

[not-null]
The geocentric coordinate system.

projection in : ICoordinateTransform

[not-null]
The map projection that defines the projected map coordinate system.

returns → Vec3D

The computed projected map coordinates (XY) and computed height (Z).

Transform the given point from its local coordinate system to a projected map coordinate system, including height.