Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Use the MapLibre CustomRenderMethod instead of private properties #9029

Open
birkskyum opened this issue Jul 16, 2024 · 3 comments
Open
Labels

Comments

@birkskyum
Copy link
Contributor

Target Use Case

Motivation: maplibre/maplibre-gl-js#3080

Proposal

To use the new return values (https://github.com/maplibre/maplibre-gl-js/pull/3136/files) to clean up the synchronization code.

@ibgreen
Copy link
Collaborator

ibgreen commented Jul 16, 2024

This new API exposes the matrix? that's great. It would be even nicer if deck.gl could supply a matrix (would enable advanced use cases like first person views, stereoscopic rendering etc).

@birkskyum
Copy link
Contributor Author

birkskyum commented Jul 16, 2024

These are exposed now:

type CustomRenderMethodInput = {
    /**
     * This value represents the distance from the camera to the far clipping plane.
     * It is used in the calculation of the projection matrix to determine which objects are visible.
     * farz should be larger than nearZ.
     */
    farZ: number;
    /**
     * This value represents the distance from the camera to the near clipping plane.
     * It is used in the calculation of the projection matrix to determine which objects are visible.
     * nearZ should be smaller than farZ.
     */
    nearZ: number;
    /** field of view of camera **/
    fov: number;
    /**
    * model view projection matrix
    * represents the matrix converting from world space to clip space
    * https://learnopengl.com/Getting-started/Coordinate-Systems
    * **/
    modelViewProjectionMatrix: mat4;
    /**
    * projection matrix
    * represents the matrix converting from view space to clip space
    * https://learnopengl.com/Getting-started/Coordinate-Systems
    */
    projectionMatrix: mat4;
}

That's an intersting idea - feel free to make a feature request for it in the maplibre-gl-js repo with these use-cases and which exact matrix is in question, we've recently tried to clean up the naming (modelViewProjectionMatrix / projectionMatrix).

@birkskyum
Copy link
Contributor Author

Just realized, this was actually only included in the newly released 4.5.1 version. Release notes here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants