Class MapMarker3DModel


  • public final class MapMarker3DModel
    extends NativeBase

    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.

    • Constructor Summary

      Constructors 
      Constructor Description
      MapMarker3DModel​(Mesh mesh)
      Creates a new 3D model from a mesh.
      MapMarker3DModel​(Mesh mesh, java.lang.String textureFilePath)
      Creates a new 3D model from mesh and texture.
      MapMarker3DModel​(Mesh mesh, java.lang.String textureFilePath, Color color)
      Creates a new 3D model from mesh, texture and color.
      MapMarker3DModel​(java.lang.String geometryFilePath)
      Creates a new 3D model from path to .obj file.
      MapMarker3DModel​(java.lang.String geometryFilePath, java.lang.String textureFilePath)
      Creates a new 3D model from path to .obj file and texture.
      MapMarker3DModel​(java.lang.String geometryFilePath, java.lang.String textureFilePath, Color color)
      Creates a new 3D model from path to .obj file, texture and color.
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MapMarker3DModel

        public MapMarker3DModel​(@NonNull
                                java.lang.String geometryFilePath,
                                @NonNull
                                java.lang.String textureFilePath,
                                @NonNull
                                Color color)

        Creates a new 3D model from path to .obj file, texture and color.

        Parameters:
        geometryFilePath -

        Absolute path to obj file.

        textureFilePath -

        Absolute path to texture file.

        color -

        Color to be blend with texture. This color is multiplied with color of texture.

      • MapMarker3DModel

        public MapMarker3DModel​(@NonNull
                                Mesh mesh,
                                @NonNull
                                java.lang.String textureFilePath,
                                @NonNull
                                Color color)
                         throws MapMarker3DModel.InstantiationException

        Creates a new 3D model from mesh, texture and color.

        Parameters:
        mesh -

        Mesh containing the 3d geometry together with texture coordinates.

        textureFilePath -

        Absolute path to texture file.

        color -

        Color to be blend with texture. This color is multiplied with color of texture.

        Throws:
        MapMarker3DModel.InstantiationException -

        Indicates what went wrong when the instantiation was attempted.

      • MapMarker3DModel

        public MapMarker3DModel​(@NonNull
                                java.lang.String geometryFilePath,
                                @NonNull
                                java.lang.String textureFilePath)

        Creates a new 3D model from path to .obj file and texture.

        Parameters:
        geometryFilePath -

        Absolute path to obj file.

        textureFilePath -

        Absolute path to texture file.

      • MapMarker3DModel

        public MapMarker3DModel​(@NonNull
                                Mesh mesh,
                                @NonNull
                                java.lang.String textureFilePath)
                         throws MapMarker3DModel.InstantiationException

        Creates a new 3D model from mesh and texture.

        Parameters:
        mesh -

        Mesh containing the 3d geometry together with texture coordinates.

        textureFilePath -

        Absolute path to texture file.

        Throws:
        MapMarker3DModel.InstantiationException -

        Indicates what went wrong when the instantiation was attempted.

      • MapMarker3DModel

        public MapMarker3DModel​(@NonNull
                                java.lang.String geometryFilePath)

        Creates a new 3D model from path to .obj file.

        Parameters:
        geometryFilePath -

        Absolute path to obj file.

      • MapMarker3DModel

        public MapMarker3DModel​(@NonNull
                                Mesh mesh)

        Creates a new 3D model from a mesh.

        Parameters:
        mesh -

        Mesh containing the 3d geometry 3D data.