[Papervision3D] Quaternions vs matrix

Philippe Ajoux philippe.ajoux at gmail.com
Tue Jan 16 14:29:45 EST 2007


Paulius Uza wrote:
> Try the same thing with:
>
> ++x[int(0)]; ++x[int(1)]; ++x[int(2)];
>
>
> Philippe Ajoux wrote:
>   
>> Tim Knip wrote:
>>   
>>     
>>> Got a MatrixMath as3 class (4x4 OpenGL column-order) which I could
>>> contribute....
>>>
>>> A matrix in this class is an array and looks like this:
>>> [
>>>   [1, 0, 0, 0],
>>>   [0, 1, 0, 0],
>>>   [0, 0, 1, 0],
>>>   [0, 0, 0, 1]
>>> ];
>>>
>>> So its array instead of object (m.a0, m.a1 etc)...
>>> Would object-access be faster the array-access?
>>>
>>> Class methods:
>>> 1. makeScale
>>> 2. makeRotation
>>> 3. makeTranslation
>>> 4. mult
>>> 5. invert
>>> also some methods for creating texture Matrix.
>>>
>>> Tim
>>>
>>> _______________________________________________
>>> Papervision3D mailing list
>>> Papervision3D at osflash.org
>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>
>>>   
>>>     
>>>       
>> I just did a quick test with 3 object variables, and one 3 element array.
>> I then timed the milliseconds it takes to have each variable incremented 
>> by 1..
>> so,
>>
>> x0++; x1++; x2++;
>>
>> and
>>
>> x[0]++; x[1]++; x[2]++;
>>
>> To do this 90,000 times it took on average:
>>
>> 30 ms for the object access and 47 ms for array access. So object access 
>> is still faster in AS3.0.
>>
>> Also, for kicks I wanted to know how long it would take to loop through 
>> the array using
>> a for loop instead of direct access. Takes about 81 ms.
>>
>> _______________________________________________
>> Papervision3D mailing list
>> Papervision3D at osflash.org
>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>
>>   
>>     
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>   
Just did that with the int(x) "trick" and did not get any different results.
After 6 trials for each case I found that it took an average of 55 ms 
for the int() AND non-int()
method. And an average of 31.75 ms for the object access. A 20 ms 
performance gap.



More information about the Papervision3D mailing list