AS3: Parsing .3ds file – Octopus

Sobota, November 26th, 2005

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Yes, it’s awesome :) In AS3 you can just get .3ds file from 3d max, parse it, and draw it on screen.
You can see it on example .3ds file – Octopus. There more the 16000 faces, and it is rendered in less then 200 ms on my machine :)

Source code is dirty and it’s part of my AS3 project FlashLife, which will be open source, so you will have source available in some time, but I can not say now, when. It is in early state :)

Enjoy.

tagged under:

ABOUT THIS AUTHOR

4 Trackbacks/Pingbacks

  1. Spätné upozorenie: Novemberain.com » ???? » ActionScript 3.0 : ??? ?????????… ?????? ? ???????????? ??????? ?? 3ds!! on November 26, 2005
  2. Spätné upozorenie: AlDev Blog » Blog Archive » as3 + … 3ds !?!?! on November 27, 2005
  3. Spätné upozorenie: JanuMedia :: Parsing .3ds files using AS3 :: November :: 2005 on November 30, 2005
  4. Spätné upozorenie: Free Adobe Macromedia Flash Web Site Design Tips Flash | low cost car insurance on Jún 17, 2009

14 Comments


  1. JesterXL
    Visit Site
    November 26th, 2005

    Results for my machine.

    Socket client
    START PARSING .3ds file
    NEW OBJECT: objcube0
    In 23 ms we have list of 4140 vertices
    In 43 ms we have list of 8276 faces
    START RENDERING
    In 118 ms we have rendered object with 8276 faces
    NEW OBJECT: objunnamed
    In 118 ms we have list of 4242 vertices
    In 119 ms we have list of 8468 faces
    START RENDERING
    In 119 ms we have rendered object with 8468 faces


  2. glad
    Visit Site
    November 26th, 2005

    cool


  3. Keith Peters
    Visit Site
    November 26th, 2005

    whoa.

    now get it rotating!


  4. Administrator
    Visit Site
    November 26th, 2005

    Sure Keith, I will try on Monday :)


  5. fandango
    Visit Site
    November 28th, 2005

    AS3 rulez, what’s next? :)
    F


  6. Sagar
    Visit Site
    November 28th, 2005

    Its actually Cool …
    AS3.0 rocks …
    on my machine it takes
    Socket client
    START PARSING .3ds file
    NEW OBJECT: objcube0
    In 6 ms we have list of 4140 vertices
    In 14 ms we have list of 8276 faces
    START RENDERING
    In 58 ms we have rendered object with 8276 faces
    NEW OBJECT: objunnamed
    In 58 ms we have list of 4242 vertices
    In 59 ms we have list of 8468 faces
    START RENDERING
    In 62 ms we have rendered object with 8468 faces


  7. David R
    Visit Site
    November 29th, 2005

    I think your timing is incorrect. For me, it takes about 2 to 2.5 seconds to render. however, adding up all the traces, the supposed total is only 302 ms.

    The output I get:
    ———————-
    Socket client
    START PARSING .3ds file
    NEW OBJECT: objcube0
    In 7 ms we have list of 4140 vertices
    In 20 ms we have list of 8276 faces
    START RENDERING
    In 68 ms we have rendered object with 8276 faces
    NEW OBJECT: objunnamed
    In 68 ms we have list of 4242 vertices
    In 68 ms we have list of 8468 faces
    START RENDERING
    In 71 ms we have rendered object with 8468 faces


  8. David R
    Visit Site
    November 29th, 2005

    forgot to say in last post…this is awesome!


  9. Administrator
    Visit Site
    November 29th, 2005

    Hi David,

    I know there is something strange, but not only in this movie. More times i have little time intervals, but rendering to the screen takes longer. Maybe because all is done in 1 frame :) It is not optimized. But timer values are correct, do not know why it is so long to reender :(


  10. hi0b
    Visit Site
    December 7th, 2005

    How you start it? reading the 3ds-file as binary code? connection to a php? i have started a ase-reader so i get a xml from a ase, but using 3ds directly would be much more nicer.. (right said? sry my bad english..)

    Its really nice to see, whats all possible with as3.. but a friend of mine will be lost only using as3.. he always did the design-part in our projects.. well i think, he has to lern a little programming now.. ;)


  11. Administrator
    Visit Site
    December 7th, 2005

    hi0b> your friend shoul wait for flash 9 :)

    parsing is easy if you know 3ds file format, just dynamicaly load it as swf, or image, onComplete just get ByteArray from it, and just parse ByteArray accordinf 3ds file format :)


  12. hi0b
    Visit Site
    December 8th, 2005

    sounds really easy.. i think in the future we will see more examples of importers, for which i use php right now.. i have also seen examples of encoding pngs and jpegs..

    good to see, that adobe pushes flash.. under macromedia, flash already reached the limits.. ;)


  13. Administrator
    Visit Site
    December 8th, 2005

    hi0b> look at this collection
    there are png , jpg ancoding as well

    http://www.franto.com/blog2/collected-links-to-actionscript-30-examples


  14. BELLinSKY
    Visit Site
    September 7th, 2008

    Whether really it is useful?
    Illustrate for 3ds max can 3d animation export in swf format.
    For more powerful & interactive 3d we have Director?!

Sorry, comments for this entry are closed at this time.

Images is enhanced with WordPress Lightbox JS by Zeo