Skip to content

Instanced Mesh for 2d objects #464

Answered by Nevsden
ErikKoinberg asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can use this for 2d objects.
You need to use an orthographic camera and use a projection matrix like this:

Example

    Camera::new_orthographic(
        window.viewport(),
        vec3(0.0, 0.0, 1.0),
        vec3(0.0, 0.0, 0.0),
        vec3(0.0, 1.0, 0.0),
        2.5,
        -0.001,
        10000.0,
    )
    ```

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by asny
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants