Changeset 8961 for code/branches/environment3/data
- Timestamp:
- Dec 7, 2011, 3:02:02 PM (13 years ago)
- Location:
- code/branches/environment3/data/levels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/environment3/data/levels/asteroidField.oxw
r8946 r8961 34 34 <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff2 /> 35 35 36 <!-- Generate asteroid field with diameter 12000 containing 250 asteroids-->36 <!-- Generate asteroid field and asteroid belt --> 37 37 <?lua 38 38 dofile("includes/asteroidField.lua") 39 asteroidField(0, 0, 5000, 100, 150, 2000, 50 );40 asteroidBelt(0, 0, 0, -48, -34, 30, 100, 200, 17000, 21000, 900 )39 asteroidField(0, 0, 5000, 100, 150, 2000, 50, 1); 40 asteroidBelt(0, 0, 0, -48, -34, 30, 100, 200, 17000, 21000, 900, 1) 41 41 ?> 42 42 -
code/branches/environment3/data/levels/includes/asteroidField.lua
r8947 r8961 1 --[[ fog generator 2 generates fog 3 posX, posY, posZ - position in space 4 size - size of billboard 5 brightness - [0,1] fog brightness 6 --]] 7 function generateFog(posX, posY, posZ, size, brightness) 8 print("<Billboard ") 9 print("position = \"") 10 print(posX) print(",") 11 print(posY) print(",") 12 print(posZ) print("\" ") 13 print("colour=\"") 14 print(brightness) print(",") 15 print(brightness) print(",") 16 print(brightness) print("\" ") 17 print("material=\"Smoke/Smoke\" scale=") 18 print(size) 19 print(" />") 20 end 21 1 22 --[[ asteroid field generator 2 23 generates asteroid field … … 5 26 radius - size of the cube around position in space 6 27 count - number of asteroids 28 fog - enable fog 0/1 7 29 --]] 8 function asteroidField(posX, posY, posZ, minSize, maxSize, radius, count )30 function asteroidField(posX, posY, posZ, minSize, maxSize, radius, count, fog) 9 31 for i = 1, count, 1 10 32 do … … 36 58 37 59 print("</StaticEntity>") 60 61 if fog == 1 and i % 5 == 0 then 62 generateFog(pX, pY, pZ, size*0.7, 0.2) 63 end 38 64 end 39 65 end … … 47 73 radius0, radius1 - inner/outer radius 48 74 count - number of asteroids 75 fog - enable fog 0/1 49 76 --]] 50 function asteroidBelt(centerX, centerY, centerZ, yaw, pitch, segments, minSize, maxSize, radius0, radius1, count )77 function asteroidBelt(centerX, centerY, centerZ, yaw, pitch, segments, minSize, maxSize, radius0, radius1, count, fog) 51 78 dPhi = (2 * math.pi) / segments 52 79 width = math.abs(radius1 - radius0) … … 69 96 asteroidField((radius * math.cos(i * dPhi)), 70 97 (radius * math.sin(i * dPhi)), 71 0, minSize, maxSize, width, segmentCount)98 0, minSize, maxSize, width, segmentCount, fog) 72 99 end 73 100
Note: See TracChangeset
for help on using the changeset viewer.