A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: 3D cube with textures and shading

  1. #1
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045

    3D cube with textures and shading

    I am looking to develop a 3d cube with dynamic textures and shading. Only 4 sides will be shown, and it will be used for a navigation. I am new to 3d in flash and don't really like complex math, so I'm sorta looking for a free as2.0 class that I can define a 3d shape and just apply textures to the sides (movieclips generated at runtime) then make it spin when a button is pressed.

    Any help in the right direction would be excellent. Thank you.

  2. #2
    Senior Member
    Join Date
    Nov 2003
    Posts
    524
    This could help.
    Not sure if it does dynamic image loading though.

    http://ericlin2.tripod.com/cube/cube2004t.html

    I have a 3D API that has what you want and more but not in AS2, still in AS1 (and the job would be too big to transpose to AS2).

  3. #3
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    that looks really cool, I'll have to take a look at it. I would assume they are attaching the sides with attachMovie and in the case, i could modify to creating that movieclip in run-time, then apply it to the side.

    would you mind showing me your 3d api? maybe if its good enough, i could adopt it to as2.0 or just use it as-is

    thanks alot!

  4. #4
    Senior Member
    Join Date
    Nov 2003
    Posts
    524
    Hi,
    Here are a few old examples I did with early versions of the API. I am a couple of versions ahead of this now.

    Transposing the code to AS2 or AS3 would be a BIG job as there are a few thousand lines of code ... not something you can whip off in a day or 2. I would have upgraded the code a long time ago but the fact is I can't afford a later version of Flash ... however if there is someone out there that would like to join in such a project just let me know I am happy to share all the code.

    Anyway for interest sake here are a few examples. These examples load textures at run-time and I have made no real effort to optimize the image files. The engine itself is very small 10-20k depending on what functionality you include. So the final .swf files are small ie .. MX3DIntro is only 19kb with a sound file included.

    Turn on your sound for this one..
    http://www.trump.net.au/~shipstern/MX3D/MX3DIntro.html

    http://www.trump.net.au/~shipstern/MX3D/geometricc.html
    http://www.trump.net.au/~shipstern/MX3D/MxComp.html
    http://www.trump.net.au/~shipstern/MX3D/mxbox.html

    Hope you find them interesting. The API is straight forward to use a basic textured 3D cube with mouse overs and full 6DOF VR with lighting would only take a few lines of code, as there are built in geometric primitives, lights cameras etc.

  5. #5
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    part of the trick is to skew the faces:

    get some information regarding skewing & slicing here:
    http://board.flashkit.com/board/showthread.php?t=722290

    and a link posted there today:
    http://www.sebleedelisle.com/?page_id=7

  6. #6
    Junior Member
    Join Date
    May 2009
    Posts
    2
    The best 3d flash cube that I know of is at http://xuroq.co.uk if you check this one out it is smooth and there is also the click and zoom feature

  7. #7
    supervillain gerbick's Avatar
    Join Date
    Jul 2000
    Location
    undecided.
    Posts
    18,986
    You do know this thread is 2 years old, right?

    [ Hello ] | [ gerbick ] | [ Ω ]

  8. #8
    Junior Member
    Join Date
    May 2009
    Posts
    2
    Oh, no I just came across it on google

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