arcball

Arcball Rotation with Quaternions (using iOS GLKit)

一笑奈何 提交于 2020-01-11 19:57:06
问题 I'm looking for a simple implementation for arcball rotation on 3D models with quaternions, specifically using GLKit on iOS . So far, I have examined the following sources: Arcball rotation with GLKit How to rotate a 3D object with touches using OpenGL I've also been trying to understand source code and maths from here and here. I can rotate my object but it keeps jumping around at certain angles, so I fear gimbal lock is at play. I'm using gesture recognizers to control the rotations (pan

Arcball Rotation at 90 degrees

血红的双手。 提交于 2019-12-22 00:37:31
问题 I have successfully implemented Arcball rotation through quaternions, but am confused at what to do when the direction vector of the camera is parallel to up vector. Currently I am just restricting the rotation along the x-axis (the pitch) when the dot product of the direction vector and the up vector exceeds 0.99. In Maya (or Max, XSI where arcball rotation is used) for example, you can rotate around in a full circle very smoothly. I am hoping for a solution similar to that of Maya's

Opengl: Keeping Arcball camera up-vector alligned with y-axis

偶尔善良 提交于 2019-12-11 01:56:15
问题 I'm essentially trying to mimic the way the camera rotates in Maya. The arcball in Maya is always aligned with the with the y-axis. So no matter where the up-vector is pointing, it's still rotated or registered with it's up-vector along the y-axis. I've been able to implement is arcball in OpenGL using C++ and Qt. But I can't figure out how to keep it's up-vector aligned. I've been able to keep it aligned at times by my code below: void ArcCamera::setPos (Vector3 np) { Vector3 up(0, 1, 0);

How to rotate about the center of screen using quaternions in opengl?

拜拜、爱过 提交于 2019-12-09 12:58:19
问题 I am trying implement arcball/trackball rotation but I have a problem with the center of rotation. I want the center to be the center of my screen no matter what. Let me explain what I have done so far. I've created a quaterion (rotation axis: vector_start x vector_end, angle: vector_start * vector_end) From that quaternion I've created a rotation matrix in order to use it with glMultMatrixf(matrix) and get the desired rotation. The problem is that while my model seems to arcball rotate as it

Arcball camera inverting at 90 deg azimuth

▼魔方 西西 提交于 2019-12-07 23:18:55
问题 I'm attempting to implement an arcball style camera. I use glm::lookAt to keep the camera pointed at a target, and then move it around the surface of a sphere using azimuth/inclination angles to rotate the view. I'm running into an issue where the view gets flipped upside down when the azimuth approaches 90 degrees. Here's the relevant code: Get projection and view martrices. Runs in the main loop void Visual::updateModelViewProjection() { model = glm::mat4(); projection = glm::mat4(); view =

Arcball camera inverting at 90 deg azimuth

风格不统一 提交于 2019-12-06 12:35:34
I'm attempting to implement an arcball style camera. I use glm::lookAt to keep the camera pointed at a target, and then move it around the surface of a sphere using azimuth/inclination angles to rotate the view. I'm running into an issue where the view gets flipped upside down when the azimuth approaches 90 degrees. Here's the relevant code: Get projection and view martrices. Runs in the main loop void Visual::updateModelViewProjection() { model = glm::mat4(); projection = glm::mat4(); view = glm::mat4(); projection = glm::perspective ( (float)glm::radians(camera.Zoom), (float)width / height,

Arcball Rotation at 90 degrees

社会主义新天地 提交于 2019-12-04 16:51:33
I have successfully implemented Arcball rotation through quaternions, but am confused at what to do when the direction vector of the camera is parallel to up vector. Currently I am just restricting the rotation along the x-axis (the pitch) when the dot product of the direction vector and the up vector exceeds 0.99. In Maya (or Max, XSI where arcball rotation is used) for example, you can rotate around in a full circle very smoothly. I am hoping for a solution similar to that of Maya's rotation. Thankyou You need to adjust both the view normal vector (VNV) and the view up vector (VUV) and

Arcball Rotation with Quaternions (using iOS GLKit)

纵饮孤独 提交于 2019-12-02 21:23:15
I'm looking for a simple implementation for arcball rotation on 3D models with quaternions, specifically using GLKit on iOS . So far, I have examined the following sources: Arcball rotation with GLKit How to rotate a 3D object with touches using OpenGL I've also been trying to understand source code and maths from here and here . I can rotate my object but it keeps jumping around at certain angles, so I fear gimbal lock is at play. I'm using gesture recognizers to control the rotations (pan gestures affect roll and yaw, rotate gestures affect pitch). I'm attaching my code for the quaternion