mesa3d-users

You can subscribe to this list here.

 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 Jan Feb Mar (11) Apr (46) May (65) Jun (85) Jul (94) Aug (99) Sep (62) Oct (58) Nov (85) Dec (39) Jan (90) Feb (29) Mar (90) Apr (96) May (78) Jun (58) Jul (44) Aug (65) Sep (40) Oct (38) Nov (79) Dec (63) Jan (53) Feb (61) Mar (43) Apr (53) May (35) Jun (59) Jul (18) Aug (12) Sep (28) Oct (61) Nov (54) Dec (23) Jan (16) Feb (42) Mar (38) Apr (35) May (20) Jun (9) Jul (10) Aug (30) Sep (22) Oct (32) Nov (25) Dec (21) Jan (39) Feb (36) Mar (59) Apr (32) May (21) Jun (4) Jul (8) Aug (21) Sep (11) Oct (21) Nov (22) Dec (19) Jan (62) Feb (24) Mar (17) Apr (16) May (16) Jun (17) Jul (26) Aug (14) Sep (13) Oct (8) Nov (23) Dec (20) Jan (41) Feb (18) Mar (21) Apr (47) May (13) Jun (33) Jul (32) Aug (21) Sep (27) Oct (34) Nov (19) Dec (46) Jan (21) Feb (26) Mar (13) Apr (22) May (5) Jun (19) Jul (56) Aug (43) Sep (37) Oct (31) Nov (53) Dec (22) Jan (74) Feb (31) Mar (15) Apr (35) May (23) Jun (26) Jul (17) Aug (27) Sep (35) Oct (30) Nov (29) Dec (17) Jan (35) Feb (39) Mar (44) Apr (28) May (20) Jun (28) Jul (49) Aug (53) Sep (23) Oct (13) Nov (12) Dec (11) Jan (45) Feb (28) Mar (41) Apr (11) May Jun Jul Aug Sep Oct Nov Dec
S M T W T F S

1

2

3
(5)
4
(1)
5

6

7

8
(6)
9

10

11

12

13
(4)
14
(3)
15

16

17
(1)
18

19

20
(5)
21
(8)
22
(1)
23
(1)
24
(2)
25
(2)
26

27
(3)
28

Showing 1 results of 1

 [Mesa3d-users] quaternions From: Carlos Pereira - 2003-02-04 19:25:58 ```Representing rotation quaternions as: q1 = (s1, v1) q2 = (s2, v2) where s=scalar, equal to q[3], and v=vector, equal to q[0], q[1], q[2], the two quaternions can be added, according to the formula: q1 * q2 = (s1s2 - v1 . v2, s1v2 + s2v1 + v1 X v2) Now, my question is, which quaternion was applied first? q1 or q2? I thought that q1 was applied AFTER q2 (exactly as matrices), so the first term in the cross product (the only that matters, all the others are commutative) represented the new applied rotation (v1) and the second term the old rotation state (v2). However, for example in the molecular example that comes with the green book (using the trackball code), they use as first term in the cross product the old rotation, as shown below: Could someone clarify this? thanks! Carlos --------------------------------------------- add_quats(spin_quat, info->quat, info->quat); <<<<<<< function call void add_quats(float q1[4], float q2[4], float dest[4]) <<<< function definition { static int count=0; float t1[4], t2[4], t3[4]; float tf[4]; vcopy(q1,t1); vscale(t1,q2[3]); vcopy(q2,t2); vscale(t2,q1[3]); vcross(q2,q1,t3); <<<<<<<<<< cross product <<<<<<<<<<<< vadd(t1,t2,tf); vadd(t3,tf,tf); tf[3] = q1[3] * q2[3] - vdot(q1,q2); dest[0] = tf[0]; dest[1] = tf[1]; dest[2] = tf[2]; dest[3] = tf[3]; if (++count > RENORMCOUNT) { count = 0; normalize_quat(dest); } } ```

Showing 1 results of 1