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

look_at for model matrices? #536

Open
swiftcoder opened this issue Jul 18, 2021 · 2 comments
Open

look_at for model matrices? #536

swiftcoder opened this issue Jul 18, 2021 · 2 comments
Labels

Comments

@swiftcoder
Copy link

In a somewhat traditional scene setup, my camera has an associated transform (i.e. the model matrix of the camera node), and then I derive the view matrix by inverting the model matrix.

Most examples I see using cgmath are assembling their view matrix by hand, which is fine, but it means that the look_at _* functions all produce view matrices. If I wanted a look_at equivalent for placing objects (i.e. their model matrices) in the scene, what's my best option?

I can obviously just call look_at_*().invert().unwrap() which is fine for now, but it feels like there could be a cleaner option

@kvark
Copy link
Collaborator

kvark commented Aug 11, 2021

I'm not familiar with look_at used for placing objects. After all, the function is about "look", it implies the camera.

@kvark kvark added the question label Aug 11, 2021
@swiftcoder
Copy link
Author

After all, the function is about "look", it implies the camera.

Lots of types of objects have an intrinsic "look" direction. Characters, spaceships, guns, and so on. But regardless of what it ends up being named, an "align object to face a point" function would be very useful.

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