A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: [disk]new 3d classes

  1. #1
    Custom User Title Incrue's Avatar
    Join Date
    Feb 2004
    Posts
    973

    [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

  2. #2
    Developer
    Join Date
    Apr 2007
    Location
    UK
    Posts
    324
    disk? Have you made any tests which compare the speeds?
    now known as dVyper

  3. #3
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    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.

  4. #4
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    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.
    lather yourself up with soap - soap arcade

  5. #5
    Senior Member
    Join Date
    Jun 2002
    Location
    Manchester, UK
    Posts
    2,357
    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

  6. #6
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    Collection also springs to mind.

    yawn, ok enough posting, off to bed
    lather yourself up with soap - soap arcade

  7. #7
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    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

  8. #8
    Senior Member rachil0's Avatar
    Join Date
    Jul 2007
    Location
    Columbus, OH.
    Posts
    465
    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.

  9. #9
    Custom User Title Incrue's Avatar
    Join Date
    Feb 2004
    Posts
    973
    And what about vector3d? It has dotproduct, normalize, like tony's vectors, but its faster?

  10. #10
    Senior Member rachil0's Avatar
    Join Date
    Jul 2007
    Location
    Columbus, OH.
    Posts
    465
    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 ...)

  11. #11
    Custom User Title Incrue's Avatar
    Join Date
    Feb 2004
    Posts
    973

  12. #12
    formerly hooligan2001 :) .hooligan's Avatar
    Join Date
    Mar 2008
    Posts
    405
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center