General > General Technical Chat

I have found the answer to life, the universe, and everything.

<< < (9/9)

ebastler:

--- Quote from: tooki on July 08, 2022, 05:02:50 pm ---I strongly suspect this is just a new account for another, troublesome member who was banned just days before this one signed up.

--- End quote ---

No, I don't think so. In the few threads he opened, the OP has given us enough detail to confirm that Peter Taylor is a real person. Unless somebody has gone through a lot of trouble to steal the identity of that real person -- including taking an early-morning photo from their backyard -- I think we are listening to the real guy here.

bd139:
Yeah. Also I've met weirder people in real life. Hell I work with weirder people.

Bud:

--- Quote from: SiliconWizard on June 05, 2022, 08:21:13 pm ---
--- Quote from: Peter Taylor on May 22, 2022, 02:57:09 pm ---The only way to create something from nothing is to break it in two.

--- End quote ---

Priceless! ;D

--- End quote ---
Can't break nothing because there is nothing to break.

Nominal Animal:

--- Quote from: bd139 on May 23, 2022, 06:15:39 pm ---Actually it’s kind of cool. The vertical and horizontal bars are scroll bars that rotate the shape in the middle, which is in fact 3d.
--- End quote ---
Uses Tait-Bryan ("Euler") angles, with rotation around X and Y axis defined by mouse dragging.  Friends don't let friends do that.

(There is a reason my fingers always first type it as Taint-Bryan.)


First, use versors (unit quaternions) or bivectors –– pick your model: the math is the same.

Second, use the trackball rotation scheme.  Within the ball, when the user drags the mouse, draw an imaginary line from the starting point to the mouse cursor.  Rotate that (in 2D) by 90° counterclockwise (by replacing (dx, dy) with (dy, -dx)), and you have the 3D rotation axis. (It's always planar to the display, z=0, but that's ok.)  Normalize that to unit length by scaling the three components by the length of the vector, i.e. square root of the sum of squared components.  The length of the original line corresponds to the rotation angle around that axis, with the radius of the imaginary trackball corresponding to 90°, and diameter to 180°.

Outside the ball, the rotation axis is the Z axis.  Use atan2() with respect to the center of the imaginary trackball to obtain the angles for the start and end point since the rotation angle is the difference between the two angles –– or basic 2D vector algebra to turn them into unit vectors; their dot product is the cosine of that angle, and the 2D analog of cross product is the sine of the angle.

A quaternion describing rotation around an unit axis vector by some angle has the cosine of half that angle as the real part, and the unit vector components multiplied by sine of half that angle as the other three components. So that's trivial to construct for both the above cases.

Save the original orientation (quaternion or bivector), and combine with the temporary new one via multiplication (Hamilton product).  That's just a single line (or four lines, if you pretty-format the code).

For drawing, scale the quaternion to unit length (by dividing each component by the square root of the sum of the squares of the original components), and then convert to a normal 3D rotation matrix.  That's eleven lines of code if pretty-formatted.

No need to copy someone elses GL Matrix JavaScript library, no need to use unintuitive rotation controls.


Why do people think that the easiest way is the crappiest way everyone else is doing?  :rant:
Euler and Tait-Bryan angles should be banned, dammit: they're like a spanner that occasionally turns to soft rubber, or a dildo that occasionally grows latching spikes.

If you do something, do it better.  The world is already drowning in crap, no need to add to that.

tooki:

--- Quote from: ebastler on July 08, 2022, 05:48:48 pm ---
--- Quote from: tooki on July 08, 2022, 05:02:50 pm ---I strongly suspect this is just a new account for another, troublesome member who was banned just days before this one signed up.

--- End quote ---

No, I don't think so. In the few threads he opened, the OP has given us enough detail to confirm that Peter Taylor is a real person. Unless somebody has gone through a lot of trouble to steal the identity of that real person -- including taking an early-morning photo from their backyard -- I think we are listening to the real guy here.

--- End quote ---
Well, we don’t know that Peter Taylor isn’t the other member’s real name! ;)

Navigation

[0] Message Index

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod