Posted By


julespong on 07/13/11

Tagged


Statistics


Viewed 174 times
Favorited by 0 user(s)

AnimatedCubeMap.as


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. package
  2. {
  3. import away3d.materials.utils.CubeMap;
  4.  
  5. import com.greensock.TweenMax;
  6.  
  7. import flash.display.BitmapData;
  8. import flash.display.Sprite;
  9.  
  10. public class AnimatedCubeMap
  11. {
  12. private var __cubeMap:CubeMap;
  13. private var __faceTop:AnimatedCubeMapFace;
  14. private var __faceBottom:AnimatedCubeMapFace;
  15. private var __faceFront:AnimatedCubeMapFace;
  16. private var __faceRear:AnimatedCubeMapFace;
  17. private var __faceLeft:AnimatedCubeMapFace;
  18. private var __faceRight:AnimatedCubeMapFace;
  19.  
  20. public function get cubeMap():CubeMap
  21. {
  22. __cubeMap = new CubeMap(__faceRight.snapshot, __faceLeft.snapshot, __faceTop.snapshot, __faceBottom.snapshot, __faceRear.snapshot, __faceFront.snapshot);
  23.  
  24. // __cubeMap.positiveX = __faceRight.snapshot;
  25. // __cubeMap.negativeX = __faceLeft.snapshot;
  26. //
  27. // __cubeMap.positiveY = __faceTop.snapshot;
  28. // __cubeMap.negativeY = __faceBottom.snapshot;
  29. //
  30. // __cubeMap.positiveZ = __faceRear.snapshot;
  31. // __cubeMap.negativeZ = __faceFront.snapshot;
  32.  
  33. return __cubeMap;
  34. }
  35.  
  36. public function AnimatedCubeMap()
  37. {
  38. init();
  39. }
  40.  
  41. private function init():void
  42. {
  43. initCubeMap();
  44. initFaces();
  45. }
  46.  
  47. private function initCubeMap():void
  48. {
  49. __cubeMap = new CubeMap();
  50. }
  51.  
  52. private function initFaces():void
  53. {
  54. __faceTop = new AnimatedCubeMapFace(new cubemap2_top(), new cubemap1_top());
  55. __faceBottom = new AnimatedCubeMapFace(new cubemap2_bottom(), new cubemap1_bottom());
  56. __faceFront = new AnimatedCubeMapFace(new cubemap2_front(), new cubemap1_front());
  57. __faceRear = new AnimatedCubeMapFace(new cubemap2_rear(), new cubemap1_rear());
  58. __faceLeft = new AnimatedCubeMapFace(new cubemap2_left(), new cubemap1_left());
  59. __faceRight = new AnimatedCubeMapFace(new cubemap2_right(), new cubemap1_right());
  60. }
  61.  
  62. }
  63. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.