Skip to content

Get the world position coordinates of the vertices of the mesh. #1983

@dungpv1992

Description

@dungpv1992

Sorry, but I’d like to ask you something. .
Currently, I need to determine which entities are inside the frustum. However, checking using the entity's AABB seems to be quite inaccurate, especially when zooming in. Therefore, I want to check using the vertices of the entity's meshes.

However, when I retrieve these positions, I notice that their coordinates are slightly offset from the entity's position. I read the source code, and it seems that these positions are already in world space. I'm not sure if any additional transformations are missing.

const mesh = entity.meshes[i];
const { positions } = mesh.layer.readGeometryData(mesh.portionId);

As shown in the attached image, it shows the position of the entity and the position of the annotation created from a vertex of the positions.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions