-
Custom User Title
[disk]new 3d classes
Like matrix3d, vector3d, is anyone playing with those already?Vector3d has a lot of stuff you could find in tony's tutorials, i wonder how faster/slower it is when used for 2d and compared to the vectors made by us
-
disk? Have you made any tests which compare the speeds?
-
Senior Member
I find F10 mixed use of "vector" still confusing. Probably because I am used to think of vectors in 2D.
vector - an array whose elements all have the same data type.
Vector3D - a point or a location in the three-dimensional space using the Cartesian coordinates x, y, and z.
-
M.D.
yeah, calling it a List or TypedArray would have made more sense. Or even just converting the array to a TypedArray, no need for both. If the array doesn't have a Type then it must be a dynamic one.
as to the thread, I really don't want to use f10 until there is a public developer release, not within the flex nightly builds. Something like the flash 9 public alpha which was released some time ago.
-
I agree also! They must have anticipated confusion here since it's a thought of as vector based tool. Remember, you could always wrap it in another class, by extending the class, with the names suggested by mr_malle!
RipX
-
M.D.
Collection also springs to mind.
yawn, ok enough posting, off to bed
-
as long as it comes with nice help files and demo code I dont mind it. Haven´t touched FP10 stuff myself though because I am busy enough crawling deeper and deeper into as3 as it stands now
-
Senior Member
I played around with Matrix3D and Vector3D and was not pleased with the results. I expected Matrix3D.transformVector(Vector3D) to be faster than the transform routines I had implemented in Flash 9, but it was actually quite a bit slower. Matrix3D.transformVectors() might be faster because it can exploit SIMD greater parallelism, but I didn't try it.
Initially, the F9/F10 implementations weren't reporting the same answers either. After some investigation, I think there is also a hidden scale factor of 20 hidden somewhere. Matrix3D works kinda like gradientBox, in that its internal units are 20'ths of pixels. A hint for finding this out yourself is looking at the w coordinate of any Vector3D after it's been transformed, it'll be 1/20.
Also, I don't think it's anywhere in the documentation, but I Matrix3D is column major (fortran style). This is important because Matrix3D's are only constructable from 1D Vector.<Number>'s with 16 elements and their order matters.
You'll have to get used to these classes if you want to transform displayObjects, but you don't actually need them if your pipeline is based on graphics.drawTriangles. Personally, I don't think I will be messing with Matrix3D or Vector3D for while.
I can post the testbed application on request.
-
Custom User Title
And what about vector3d? It has dotproduct, normalize, like tony's vectors, but its faster?
-
Senior Member
All I tried was matrix-vector products. My expectation is that unless you are doing a very large number of operations, it will be tough to observe any speed difference between flash.geom.Vector3D and something you rolled on your own. IMO the function call will almost always dominate the arithmetic when it comes to operations like these (dot, normalize, cross ...)
-
Custom User Title
-
formerly hooligan2001 :)
Yeah when I read vector I always instantly think Vector array from java. I guess extending them and naming them how I want should be helpful. Not going to play around with it till a public release like a couple of the other guys stated too.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|