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
Changing rotation (i.e. up-vector) of camera? #122
Comments
The only way to change the up-vector is to define your own camera (implementing the Camera trait). Currently, both |
If I find the time, I might prepare a PR. Something like a (P.S: I find it strange that the default up-vector is not the z-axis. Wouldn't most people want to use z as the vertical axis in the world frame...?) |
Yup, I've always worked with the y axis as the "vertical" direction, and so did the few teams I've worked with so far. But I guess conventions differ depending on the field and on the people! |
New function to change axis pointing upward on First Person camera. Related to issue sebcrozet#122. Default is still Y axis. Example: let eye = Point3::new(20.0_f32, 20.0, 20.0); let at = Point3::origin(); let mut first_person = FirstPerson::new(eye, at); first_person.set_up_axis(Vector3::z());
…ebcrozet#122] Solves issue sebcrozet#122. New function to change axis pointing upward on First Person camera. Default is still Y axis. Example: let eye = Point3::new(20.0_f32, 20.0, sebcrozet#20.0); let at = Point3::origin(); let mut first_person = FirstPerson::new(eye, at); first_person.set_up_axis(Vector3::z());
I submitted PR #145 with a function to change up-axis.
Example:
|
Function to change axis pointing upward on First Person camera [issue #122]
…crozet#122] New function to change axis pointing upward on Arc Ball camera. - Important! Only rendering view is changed, meaning camera movements using keyboard/mouse are only consistent when using Y axis up - Default is still Y axis up. - Procedural objects are still pointing upward in Y direction when generated. Example: let eye = Point3::new(20.0_f32, 20.0, 20.0); let at = Point3::origin(); let mut first_person = ArcBall::new(eye, at); first_person.set_up_axis(Vector3::z());
I submitted PR #146 with a function to change up-axis on Arc Ball camera. Important! I didn't mention it in previous PR, but for both First Person and Arc Ball cameras, view only is affected, not camera movements. It means camera movements using keyboard/mouse are only consistent when using Y axis up. PR note:
Further consideration on camera movements: Making camera movements consistent with chosen up-axis would require adding conditional statements in many functions, hence complexifying code source and increasing its length significantly. I'm not sure that's what you want in a KISS project. Usage example: let eye = Point3::new(20.0_f32, 20.0, 20.0); |
Function to change axis pointing upward on Arc Ball camera [issue #122]
I'm trying to fix up the controls for the Arc Ball camera at least, but possibly also the First Person camera later. I only care for the right-handed Z-up case but I also want to do it properly for it to be merged, so there are a few questions that need to be answered:
|
This fixes the camera controls of the Arc Ball camera with up_axis set to `Vector3::z()`. The method `set_up_axis` now also panics when a value other than `Vector3::y()` and `Vector3::z()` is given as they are not supported. See also: Issue sebcrozet#122
This fixes the camera controls of the First Person camera with up_axis set to `Vector3::z()`. The method `set_up_axis` now also panics when a value other than `Vector3::y()` and `Vector3::z()` is given as they are not supported. See also: Issue sebcrozet#122
This fixes the camera controls of the First Person camera with up_axis set to `Vector3::z()`. The method `set_up_axis` now also panics when a value other than `Vector3::y()` and `Vector3::z()` is given as they are not supported. See also: Issue sebcrozet#122
This adds `set_up_axis_dir` and changes `set_up_axis` to accept any up vector instead of limiting to only Y-up or Z-up. Still, only right-handed coordinate systems are supported. See also: Issue sebcrozet#122, PR sebcrozet#199
This adds `set_up_axis_dir` and changes `set_up_axis` to accept any up vector instead of limiting to only Y-up or Z-up. Still, only right-handed coordinate systems are supported. See also: Issue sebcrozet#65, Issue sebcrozet#122, PR sebcrozet#199
This adds `set_up_axis_dir` and changes `set_up_axis` to accept any up vector instead of limiting to only Y-up or Z-up. Still, only right-handed coordinate systems are supported. See also: Issue sebcrozet#122, PR sebcrozet#199
This adds `set_up_axis_dir` and changes `set_up_axis` to accept any up vector instead of limiting to only Y-up or Z-up. Still, only right-handed coordinate systems are supported. See also: Issue sebcrozet#122, PR sebcrozet#199
I cannot for the life of me figure out how to change the rotation of the camera. By rotation I mean rotation with respect to the direction the camera is pointing, i.e. changing the up vector, or, I think, the "roll" of the camera. Am I simply looking in the wrong places?
The text was updated successfully, but these errors were encountered: