falstro
Reputation
978
Top tag
Next privilege 1,000 Rep.
 Oct 20 awarded Famous Question Apr 13 awarded Nice Answer Jul 22 awarded Yearling May 15 comment How can I compare two quaternions for logical equality? @bogglez true. Was hidden in the tl;dr text. :) May 15 revised How can I compare two quaternions for logical equality? deleted 1 character in body May 15 answered How can I compare two quaternions for logical equality? May 15 comment How can I compare two quaternions for logical equality? Exactly, when you execute either rotation, you'll end up with the same orientation, but interpolate it (whether you lerp or slerp or some other fancy interpolation), you'll see it is turning different ways. And yes, the angle argument is negated, but that's the same as `2pi-angle`, so it's turning the long way around the negated axes. Sometimes this is what you want though; it's just something to be aware of, `q1 dot q2 > 0` results in the short turn, `q1 dot q2 < 0` takes the long turn. May 15 comment How can I compare two quaternions for logical equality? +1, one nitpick though, `q` and `-q` represent the same orientation (which was being asked for), but not the same rotation. This is crucial when interpolating. May 13 comment openGL Camera setup for Zoom in/out centered at point under cursor @user3228921 you want to translate the camera without turning, the easiest way to do this using a look-at target is to move them in parallel. That is, if you have a vector `v` from the camera to the point-under-cursor, you add the same fraction of that vector to both the camera and the look-at target. That will shift the entire set-up without turning the camera. May 12 comment Using same buffer for vertex and index data? Excellent, thank you! Last paragraph is also exactly why I asked a question and didn't just test and see if it works. May 12 accepted Using same buffer for vertex and index data? May 12 comment Using same buffer for vertex and index data? I certainly would not mix vertex and index data (ending up with non-uniform data), it's just laid out sequentially the way you're saying (padded for proper alignment of course). But I guess you're right. I'll get working on doing separate uploads. May 12 comment Using same buffer for vertex and index data? @PandaPajama I've considered that, but if it works it only means it works on my set up; undefined behavior is undefined you know. :) And I figured before I implement it either way, someone might already know. May 12 asked Using same buffer for vertex and index data? May 11 comment openGL Camera setup for Zoom in/out centered at point under cursor @user3228921 I see, you're using gluLookAt. Either you ditch that function and manually control your camera orientation, or - if you insist on using gluLookAt - you'd have to translate your lookat-target exactly parallel to your camera. This seems a bit contrived, so unless you have a real good reason for using gluLookAt, I would advise against it. May 11 revised openGL Camera setup for Zoom in/out centered at point under cursor moved a comment into the answer May 11 comment openGL Camera setup for Zoom in/out centered at point under cursor @user3228921 I'm not sure exactly what you're trying to say. The idea is to keep the angle to your 'point-under-cursor' (or 'target' as I call it) constant. By keeping the orientation of the camera constant so the forward-vector doesn't change, and only moving it ('translating it', or 'dolly', however you want to call it) along the eye-target vector, that angle to your target will remain constant, but you will get closer so stuff will get bigger. Note that this is not what you normally call 'zoom' (where the field of view is reduced) May 11 comment openGL Camera setup for Zoom in/out centered at point under cursor @user3228921 Yes, you understood correctly, and no, if you don't turn the camera, only move it, the point under the cursor will not move on the screen. May 11 answered openGL Camera setup for Zoom in/out centered at point under cursor May 11 comment openGL Camera setup for Zoom in/out centered at point under cursor The question is basically how to dolly the camera to get closer, while keeping a specific world space point fixed on screen. (Which incidentally means moving directly towards that point)