f3d-app / f3d

Fast and minimalist 3D viewer.
https://f3d.app
BSD 3-Clause "New" or "Revised" License
2.81k stars 204 forks source link

Add getters for camera parameters #1419

Open Nokse22 opened 5 months ago

Nokse22 commented 5 months ago

Is your feature request related to a problem? Please describe. When using libf3d and an external window you will need to use yaw, azimuth, elevation to move but to get them in degree you would need to calculate them from the camera position.

Describe the solution you'd like It could be useful to have getters for these parameters. I know they are not actually parameters, but ways to manipulate the camera, but a getter for yaw/elevation that returns the angle of the camera to the model can be useful, also distance from the model etc.

Suggested implementation In camera.h and camera.cxx , add camera::getYaw, camera::getAzimuth, camera::getElevation. Implement them to be computed on the fly.

mwestphal commented 5 months ago

but a getter for yaw/elevation that returns the angle of the camera to the model can be useful

I suppose they could be computed for easier usage of the class indeed.

distance from the model etc.

This one is way more complex, unless you mean distance to the focal point.

Nokse22 commented 5 months ago

This one is way more complex, unless you mean distance to the focal point.

Yes, from the focal point.

Schwarzemann commented 2 weeks ago

I'd like to work on this.