@masatomakino/threejs-position-util
    Preparing search index...

    Function get2DPositionWithMesh

    • Project mesh center to 2D screen coordinates. Useful for positioning UI elements relative to 3D objects.

      Parameters

      • mesh: Mesh

        The mesh to project

      • camera: Camera

        The camera used for projection

      • canvasW: number

        The width of the canvas in pixels

      • canvasH: number

        The height of the canvas in pixels

      Returns Vector3

      The 2D screen coordinates of the mesh center