ratchetfreak
302 posts

#12751
3D rotations with 3D Gibbs vectors in place of 4D quaternions 2 months, 2 weeks ago gingerBill zero rotation is 0,0,0,1 and full 360 rotation is 0,0,0,1. There is no axis information here at all. The 180° turn has w = 0 and the x, y and z matching the unit rotation axis. 
gingerBill
Ginger Bill 212 posts
2 projects
I am ginger thus have no soul. 
#12752
3D rotations with 3D Gibbs vectors in place of 4D quaternions 2 months, 2 weeks ago Edited by Ginger Bill on Aug. 4, 2017, 11:26 a.m.
Which is kind of my point. RPs cannot be used to store an orientation which can then be used as a rotation. Depending on the encoding, either half a turn or a full turn cannot be represented with RPs.

Procedural
30 posts

#12753
3D rotations with 3D Gibbs vectors in place of 4D quaternions 2 months, 2 weeks ago gingerBill Yes, and for Gibbs vectors this information is length of a vector. Because we already know their length, it equals to one, these are versors. So we lose 4th dimension to drop length information we already know. gingerBill Real world fact #1: 3 is less than 4. Gibbs vectors are smaller than quaternions. Real world fact #2: The fallacy of your statement is that it assumes Gibbs vectors require more compute power than quaternions. They don't. Quaternion product:
Gibbs vector product: Removing forth vector component by replacing it with 1, adding 3 divides to encode dot product into the vector components:
Removing 7 multiply instructions because we know multiplying a value by 1 yields that value without a change:
7 fp multiplies less, 3 fp divides more than quaternions. gingerBill It's a win in space / win in performance situation, that's the reality. 
gingerBill
Ginger Bill 212 posts
2 projects
I am ginger thus have no soul. 
#12754
3D rotations with 3D Gibbs vectors in place of 4D quaternions 2 months, 2 weeks ago
3 divides may be more expensive than 7 multiplies. Show me the empirical evidence, not theoretical! I don't care if 3 is less than 4 if the real world cost doesn't actually work.
You have lost information and you have lost over advantages that quaternions possess. You cannot represent all angles and you cannot interpolate. 
Procedural
30 posts

#12755
3D rotations with 3D Gibbs vectors in place of 4D quaternions 2 months, 2 weeks ago ratchetfreak turning in a circle needs to be rotated 180° compared to the starting position How's turning in a circle related to immediately turning 180°? 
Procedural
30 posts

#12756
3D rotations with 3D Gibbs vectors in place of 4D quaternions 2 months, 2 weeks ago gingerBill Excuse me? gingerBill Length of a vector, not lost but assumed to be one. gingerBill I lost exactly 1 advantage, rotating 180° in one operation no one does practically. gingerBill That's a lie, they can represent any angle you want, otherwise how's GpuLib example (linked in the first post) rotates camera full 360° with Gibbs vectors? Are you sure you applied them practically in real world applications? 
gingerBill
Ginger Bill 212 posts
2 projects
I am ginger thus have no soul. 
#12757
3D rotations with 3D Gibbs vectors in place of 4D quaternions 2 months, 2 weeks ago
What I should have said is "you cannot represent all angles uniquely".
"3 divides may be more expensive than 7 multiplies" It is on many architectures. Show me the empirical evidence! 
Procedural
30 posts

#12758
3D rotations with 3D Gibbs vectors in place of 4D quaternions 2 months, 2 weeks ago gingerBill I like the transition between unsure "may be" to confident "it is" :) Is it because you checked the cost yourself and got so confident in saying this? Which architecture we're talking about? 
gingerBill
Ginger Bill 212 posts
2 projects
I am ginger thus have no soul. 
#12759
3D rotations with 3D Gibbs vectors in place of 4D quaternions 2 months, 2 weeks ago ProceduralgingerBill Show me the empirical evidence to prove your points! As much I love doing theoretical work, it means diddly squat if it doesn't prove itself in the real world. 
Procedural
30 posts

#12760
3D rotations with 3D Gibbs vectors in place of 4D quaternions 2 months, 2 weeks ago
Before talking about the performance cost I want to get back to this statement of yours:
gingerBill Should I start teach you how computer memory work? That 96 bits is less than 128 and when multiplied to great amounts, say, to 100_000_000 of such vectors, you save 400 megabytes of data transfer? Or that moving data has more cost in modern architectures than ALU operations? That you can fit more stuff in cache? 
gingerBill
Ginger Bill 212 posts
2 projects
I am ginger thus have no soul. 
#12761
3D rotations with 3D Gibbs vectors in place of 4D quaternions 2 months, 2 weeks ago
I'm not going to continue this thread until you show me the empirical evidence to prove your points!
Last remark, most GPUs require 16 byte alignment for both vec3 and vec4. 
ratchetfreak
302 posts

#12762
3D rotations with 3D Gibbs vectors in place of 4D quaternions 2 months, 2 weeks ago Proceduralratchetfreak orienting a model is usually done by composing orientations which are stored separately and updated individually, if any of those orientations being composed is a 180° rotation you get a glitch. If the car model faces north by default and it should be displayed facing south the model to world rotation is a 180° rotation 
mmozeiko
Mārtiņš Možeiko 1485 posts
1 project

#12763
3D rotations with 3D Gibbs vectors in place of 4D quaternions 2 months, 2 weeks ago Edited by Mārtiņš Možeiko on Aug. 4, 2017, 5:38 p.m. Procedural I like the transition between unsure "may be" to confident "it is" :) Is it because you checked the cost yourself and got so confident in saying this? Which architecture we're talking about? Yes, it is. DIV is more expensive than MUL. You should be actually doing 1.0/t and then multiplying this three times to xyz. From http://www.agner.org/optimize/instruction_tables.pdf on skylake: MULSS  Latency=4, Throughput=0.5 DIVSS  Latency=11, Throughput=3 Similar thing happens also on GPU. On ARM it will be even worse. gingerBill Afaik there are limitations like that only for uniforms in some cases. But in vertex buffer or textures there is no such requirement. 
Procedural
30 posts

#12767
3D rotations with 3D Gibbs vectors in place of 4D quaternions 2 months, 2 weeks ago
I think it'll be fair to compare 1 div to 2 muls (given 3 divs of Gibbs vector vs 7 muls of quaternion), also we should compare vector instruction costs...

mmozeiko
Mārtiņš Možeiko 1485 posts
1 project

#12768
3D rotations with 3D Gibbs vectors in place of 4D quaternions 2 months, 2 weeks ago Edited by Mārtiņš Možeiko on Aug. 4, 2017, 5:41 p.m.
For Skylake the performance of MULPS and DIVPS is the same as for MULSS and DIVSS.
