home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / Chip_2004-07_cd1.bin / oddech / pipe / PipeDownDemo.exe / 2057 / SHOCKWAVE / 132 / 00006_SkyBox.ls < prev    next >
Encoding:
Text File  |  2004-05-25  |  4.4 KB  |  106 lines

  1. property poSkyBox, pMFront, pMBack, pMLeft, pMRight, pMUp, pMDown, pFrontOrientation, pBackOrientation, pLeftOrientation, pRightOrientation, pUpOrientation, pDownOrientation
  2. global w3d
  3.  
  4. on beginSprite me
  5.   me.createSkyBox()
  6. end
  7.  
  8. on enterFrame me
  9.   poSkyBox.update()
  10. end
  11.  
  12. on createSkyBox me
  13.   poSkyBox = script("[P] Skybox").new(w3d, "Skybox", 1)
  14.   me.SetUpFace(#front)
  15.   me.SetUpFace(#back)
  16.   me.SetUpFace(#left)
  17.   me.SetUpFace(#right)
  18.   me.SetUpFace(#up)
  19.   me.SetUpFace(#down)
  20.   poSkyBox.SetSize(100000.0)
  21.   poSkyBox.build()
  22. end
  23.  
  24. on SetUpFace me, tFace
  25.   tOrientation = me.GetOrientation(tFace)
  26.   case tFace of
  27.     #front:
  28.       poSkyBox.SetFace(#front, pMFront, tOrientation)
  29.     #back:
  30.       poSkyBox.SetFace(#back, pMBack, tOrientation)
  31.     #left:
  32.       poSkyBox.SetFace(#left, pMLeft, tOrientation)
  33.     #right:
  34.       poSkyBox.SetFace(#right, pMRight, tOrientation)
  35.     #up:
  36.       poSkyBox.SetFace(#up, pMUp, tOrientation)
  37.     #down:
  38.       poSkyBox.SetFace(#down, pMDown, tOrientation)
  39.   end case
  40. end
  41.  
  42. on GetOrientation me, tFace
  43.   case tFace of
  44.     #front:
  45.       tOrientation = pFrontOrientation
  46.     #back:
  47.       tOrientation = pBackOrientation
  48.     #left:
  49.       tOrientation = pLeftOrientation
  50.     #right:
  51.       tOrientation = pRightOrientation
  52.     #up:
  53.       tOrientation = pUpOrientation
  54.     #down:
  55.       tOrientation = pDownOrientation
  56.   end case
  57.   case tOrientation of
  58.     "None":
  59.       tNewOrientation = VOID
  60.     "Flip horizontally":
  61.       tNewOrientation = #fliphorizontal
  62.     "Flip vertically":
  63.       tNewOrientation = #flipvertical
  64.     "Rotate clockwise 90 degrees":
  65.       tNewOrientation = #rotatecw
  66.     "Rotate counter-clockwise 90 degrees":
  67.       tNewOrientation = #rotateccw
  68.     "Rotate 180 degrees":
  69.       tNewOrientation = [#fliphorizontal, #flipvertical]
  70.   end case
  71.   return tNewOrientation
  72. end
  73.  
  74. on getPropertyDescriptionList me
  75.   tlData = [:]
  76.   tlMRange = []
  77.   repeat with a = 1 to the number of castLibs
  78.     repeat with b = 1 to the number of castMembers of castLib a
  79.       if member(b, a).type = #bitmap then
  80.         tlMRange.add(member(b, a))
  81.       end if
  82.     end repeat
  83.   end repeat
  84.   tMDefault = tlMRange[1]
  85.   tlOrientations = ["None", "Flip horizontally", "Flip vertically", "Rotate clockwise 90 degrees", "Rotate counter-clockwise 90 degrees", "Rotate 180 degrees"]
  86.   tCR = RETURN & "--------------------"
  87.   tlData[#pMFront] = [#format: #member, #default: tMDefault, #range: tlMRange, #comment: "Choose FRONT image"]
  88.   tlData[#pFrontOrientation] = [#format: #string, #default: "None", #range: tlOrientations, #comment: "Choose FRONT orientation" & tCR]
  89.   tlData[#pMBack] = [#format: #member, #default: tMDefault, #range: tlMRange, #comment: "Choose BACK image"]
  90.   tlData[#pBackOrientation] = [#format: #string, #default: "None", #range: tlOrientations, #comment: "Choose BACK orientation" & tCR]
  91.   tlData[#pMLeft] = [#format: #member, #default: tMDefault, #range: tlMRange, #comment: "Choose LEFT image"]
  92.   tlData[#pLeftOrientation] = [#format: #string, #default: "None", #range: tlOrientations, #comment: "Choose LEFT orientation" & tCR]
  93.   tlData[#pMRight] = [#format: #member, #default: tMDefault, #range: tlMRange, #comment: "Choose RIGHT image"]
  94.   tlData[#pRightOrientation] = [#format: #string, #default: "None", #range: tlOrientations, #comment: "Choose RIGHT orientation" & tCR]
  95.   tlData[#pMUp] = [#format: #member, #default: tMDefault, #range: tlMRange, #comment: "Choose UP image"]
  96.   tlData[#pUpOrientation] = [#format: #string, #default: "None", #range: tlOrientations, #comment: "Choose UP orientation" & tCR]
  97.   tlData[#pMDown] = [#format: #member, #default: tMDefault, #range: tlMRange, #comment: "Choose DOWN image"]
  98.   tlData[#pDownOrientation] = [#format: #string, #default: "None", #range: tlOrientations, #comment: "Choose DOWN orientation" & tCR]
  99.   tlData[#pFOVStart] = [#format: #float, #default: 75, 3: 0, #range: [#min: 1.0, #max: 160.0], #comment: "Choose start FIELD OF VIEW"]
  100.   tlData[#pFOVMin] = [#format: #float, #default: 10.0, #range: [#min: 1.0, #max: 160.0], #comment: "Choose minimum FIELD OF VIEW"]
  101.   tlData[#pFOVMax] = [#format: #float, #default: 160.0, #range: [#min: 1.0, #max: 160.0], #comment: "Choose maximum FIELD OF VIEW" & tCR]
  102.   tlData[#pRotateSpeed] = [#format: #float, #default: 5.0, #range: [#min: 1.0, #max: 10.0], #comment: "Choose ROTATION SPEED (1.0 = slow, 10 = fast)"]
  103.   tlData[#pZoomSpeed] = [#format: #float, #default: 3.0, #range: [#min: 1.0, #max: 10.0], #comment: "Choose ZOOM SPEED (1.0 = slow, 10 = fast)"]
  104.   return tlData
  105. end
  106.