MapMarker3DModel
public class MapMarker3DModel
extension MapMarker3DModel: NativeBase
extension MapMarker3DModel: Hashable
Represents a 3D model that can be used by a MapMarker3D to be shown on the map.
Geometry of 3D marker can be provided in form of a Wavefront OBJ file as specified in
http://www.martinreddy.net/gfx/3d/OBJ.spec or as mesh built via MeshBuilder.
1. Creating MapMarker3DModel from OBJ file
For OBJ files, HERE SDK only supports the following set of features of the OBJ specification:
- Triangle Meshes
- Following vertex attributes must be present:
- Vertex Position
- Vertex Normal
- Texture Coordinates
- Geometry must be indexed (contain an Index Buffer)
- Face element
HERE SDK does not support:
- Multi Texturing
- Materials (mtllib [external .mtl file name] )
- Lines
- Higher Order Surfaces
- Vendor specific extensions
For supported texture formats, HERE SDK allows the following formats to be specified: JPG, PNG, GPU compressed texture formats: ECT1 (OpenGL only), YUV, ASTC, KTX.
2. Creating MapMarker3DModel programatically
A 3D mesh can be specified programatically using MeshBuilder and passed to
MapMarker3DModel constructor. This method supports creating a mesh from
quads and triangles. Textured geometry is also supported, the mesh faces
need to have texture coordinates and a texture file needs to be passed
along with the mesh to MapMarker3DModel constructor.
-
Thrown when a problem occurs while trying to create
MapMarker3DModel.Declaration
Swift
public typealias InstantiationError = InstantiationErrorCode -
Creates a new 3D model from path to .obj file, texture and color.
Declaration
Swift
public init(geometryFilePath: String, textureFilePath: String, color: UIColor)Parameters
geometryFilePathAbsolute path to obj file.
textureFilePathAbsolute path to texture file.
colorColor to be blend with texture. This color is multiplied with color of texture.
-
Creates a new 3D model from mesh, texture and color.
Throws
MapMarker3DModel.InstantiationErrorIndicates what went wrong when the instantiation was attempted.Declaration
Swift
public init(mesh: Mesh, textureFilePath: String, color: UIColor) throwsParameters
meshMesh containing the 3d geometry together with texture coordinates.
textureFilePathAbsolute path to texture file.
colorColor to be blend with texture. This color is multiplied with color of texture.
-
Creates a new 3D model from path to .obj file and texture.
Declaration
Swift
public init(geometryFilePath: String, textureFilePath: String)Parameters
geometryFilePathAbsolute path to obj file.
textureFilePathAbsolute path to texture file.
-
Creates a new 3D model from mesh and texture.
Throws
MapMarker3DModel.InstantiationErrorIndicates what went wrong when the instantiation was attempted.Declaration
Swift
public init(mesh: Mesh, textureFilePath: String) throwsParameters
meshMesh containing the 3d geometry together with texture coordinates.
textureFilePathAbsolute path to texture file.
-
Creates a new 3D model from path to .obj file.
Declaration
Swift
public init(geometryFilePath: String)Parameters
geometryFilePathAbsolute path to obj file.
-
Creates a new 3D model from a mesh.
Declaration
Swift
public init(mesh: Mesh)Parameters
meshMesh containing the 3d geometry 3D data.
-
Indicates the reason for a failure to create
See moreMapMarker3DModel.Declaration
Swift
public enum InstantiationErrorCode : UInt32, CaseIterable, Codableextension MapMarker3DModel.InstantiationErrorCode : Error