test_scene.js 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. var scene = {
  2. "type" : "scene",
  3. "urlBaseType" : "relativeToHTML",
  4. "objects":
  5. {
  6. "cube1" : {
  7. "geometry" : "cube",
  8. "materials": [ "lambert_red" ],
  9. "position" : [ 0, 0, 0 ],
  10. "rotation" : [ 0, -0.3, 0 ],
  11. "scale" : [ 1, 1, 1 ],
  12. "visible" : true
  13. },
  14. "cube2" : {
  15. "geometry" : "cube",
  16. "materials": [ "basic_white" ],
  17. "position" : [ 0, 0, 0 ],
  18. "rotation" : [ 0, -0.3, 0 ],
  19. "scale" : [ 2, 2, 2 ],
  20. "visible" : true
  21. },
  22. "cube3" : {
  23. "geometry" : "cube",
  24. "materials": [ "minecraft" ],
  25. "position" : [ -30, -5, 25 ],
  26. "rotation" : [ 0, 0.8, 0 ],
  27. "scale" : [ 1, 1, 1 ],
  28. "visible" : true
  29. },
  30. "sphere_lambert" : {
  31. "geometry" : "sphere",
  32. "materials": [ "lambert_green" ],
  33. "position" : [ -20, -5, 15 ],
  34. "rotation" : [ 0, 0, 0 ],
  35. "scale" : [ 1, 1, 1 ],
  36. "visible" : true
  37. },
  38. "sphere_refraction" : {
  39. "geometry" : "sphere",
  40. "materials": [ "basic_refraction" ],
  41. "position" : [ 50, 45, -50 ],
  42. "rotation" : [ 0, 0, 0 ],
  43. "scale" : [ 1, 1, 1 ],
  44. "visible" : true
  45. },
  46. "icosahedron" : {
  47. "geometry" : "icosahedron",
  48. "materials": [ "faceted_white" ],
  49. "position" : [ 20, 10, -60 ],
  50. "rotation" : [ 0, 0, 0 ],
  51. "scale" : [ 20, 20, 20 ],
  52. "visible" : true
  53. },
  54. "torus" : {
  55. "geometry" : "torus",
  56. "materials": [ "phong_orange" ],
  57. "position" : [ -20, 5, -50 ],
  58. "rotation" : [ 0, 0, 0 ],
  59. "scale" : [ 2, 2, 2 ],
  60. "visible" : true
  61. },
  62. "cone" : {
  63. "geometry" : "cone",
  64. "materials": [ "lambert_blue" ],
  65. "position" : [ -50, 15, -50 ],
  66. "rotation" : [ 1.57, 0, 0 ],
  67. "scale" : [ 1, 1, 1 ],
  68. "visible" : true
  69. },
  70. "cylinder" : {
  71. "geometry" : "cylinder",
  72. "materials": [ "lambert_blue" ],
  73. "position" : [ 50, 15, -50 ],
  74. "rotation" : [ 1.57, 0, 0 ],
  75. "scale" : [ 1, 1, 1 ],
  76. "visible" : true
  77. },
  78. "veyron" : {
  79. "geometry" : "veyron",
  80. "materials": [ "face" ],
  81. "position" : [ 40, -1, 0 ],
  82. "rotation" : [ 0, 0.3, 0 ],
  83. "scale" : [ 0.25, 0.25, 0.25 ],
  84. "visible" : true
  85. },
  86. "walt" : {
  87. "geometry" : "WaltHead",
  88. "materials": [ "lambert_cube" ],
  89. "position" : [ -45, 10, 0 ],
  90. "rotation" : [ 0, 0, 0 ],
  91. "scale" : [ 0.5, 0.5, 0.5 ],
  92. "visible" : true
  93. },
  94. "quad_bg" : {
  95. "geometry" : "quad",
  96. "materials": [ "textured_bg" ],
  97. "position" : [ 0, 15, -90 ],
  98. "rotation" : [ 0, 0, 0 ],
  99. "scale" : [ 20, 20, 20 ],
  100. "visible" : true
  101. },
  102. "ground" : {
  103. "geometry" : "plane",
  104. "materials": [ "basic_gray" ],
  105. "position" : [ 0, -10, 0 ],
  106. "rotation" : [ 1.57, 0, 0 ],
  107. "scale" : [ 100, 100, 100 ],
  108. "visible" : true
  109. }
  110. },
  111. "geometries":
  112. {
  113. "cube": {
  114. "type" : "cube",
  115. "width" : 10,
  116. "height": 10,
  117. "depth" : 10,
  118. "segmentsWidth" : 1,
  119. "segmentsHeight" : 1,
  120. "segmentsDepth" : 1,
  121. "flipped" : false,
  122. "sides" : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
  123. },
  124. "plane": {
  125. "type" : "plane",
  126. "width" : 10,
  127. "height" : 10,
  128. "segmentsWidth" : 50,
  129. "segmentsHeight" : 50
  130. },
  131. "quad": {
  132. "type" : "plane",
  133. "width" : 10,
  134. "height" : 10,
  135. "segmentsWidth" : 1,
  136. "segmentsHeight" : 1
  137. },
  138. "sphere": {
  139. "type" : "sphere",
  140. "radius" : 5,
  141. "segmentsWidth" : 32,
  142. "segmentsHeight" : 16
  143. },
  144. "icosahedron": {
  145. "type" : "icosahedron",
  146. "subdivisions" : 2
  147. },
  148. "torus": {
  149. "type" : "torus",
  150. "radius" : 5,
  151. "tube" : 2,
  152. "segmentsR" : 16,
  153. "segmentsT" : 32
  154. },
  155. "cylinder": {
  156. "type" : "cylinder",
  157. "numSegs" : 32,
  158. "topRad" : 5,
  159. "botRad" : 5,
  160. "height" : 50,
  161. "topOffset": 0,
  162. "botOffset": 0
  163. },
  164. "cone": {
  165. "type" : "cylinder",
  166. "numSegs" : 32,
  167. "topRad" : 0,
  168. "botRad" : 5,
  169. "height" : 50,
  170. "topOffset": 0,
  171. "botOffset": 0
  172. },
  173. "WaltHead": {
  174. "type": "bin_mesh",
  175. "url" : "obj/walt/WaltHead_bin.js"
  176. },
  177. "veyron": {
  178. "type": "bin_mesh",
  179. "url" : "obj/veyron/VeyronNoUv_bin.js"
  180. }
  181. },
  182. "materials":
  183. {
  184. /*
  185. "basic_red": {
  186. "type": "MeshBasicMaterial",
  187. "parameters": { color: 0xff0000, wireframe: true }
  188. },
  189. "basic_green": {
  190. "type": "MeshBasicMaterial",
  191. "parameters": { color: 0x007711, wireframe: true }
  192. },
  193. "basic_blue": {
  194. "type": "MeshBasicMaterial",
  195. "parameters": { color: 0x0000ff, wireframe: true }
  196. },
  197. "basic_black": {
  198. "type": "MeshBasicMaterial",
  199. "parameters": { color: 0x000000, wireframe: true }
  200. },
  201. "phong_white": {
  202. "type": "MeshPhongMaterial",
  203. "parameters": { color: 0xaaaaaa }
  204. },
  205. */
  206. "basic_gray": {
  207. "type": "MeshBasicMaterial",
  208. "parameters": { color: 0x666666, wireframe: true }
  209. },
  210. "basic_white": {
  211. "type": "MeshBasicMaterial",
  212. "parameters": { color: 0xffffff, wireframe: true }
  213. },
  214. "faceted_white": {
  215. "type": "MeshLambertMaterial",
  216. "parameters": { color: 0xffffff, shading: "flat" }
  217. },
  218. "lambert_red": {
  219. "type": "MeshLambertMaterial",
  220. "parameters": { color: 0xff0000 }
  221. },
  222. "lambert_green": {
  223. "type": "MeshLambertMaterial",
  224. "parameters": { color: 0x007711, blending: "AdditiveBlending", transparent: true }
  225. },
  226. "lambert_blue": {
  227. "type": "MeshLambertMaterial",
  228. "parameters": { color: 0x0055aa }
  229. },
  230. "phong_orange": {
  231. "type": "MeshPhongMaterial",
  232. "parameters": { color:0x000000, specular: 0xaa5500 }
  233. },
  234. "basic_refraction": {
  235. "type": "MeshBasicMaterial",
  236. "parameters": { color: 0xffffff, envMap: "cube_refraction", refractionRatio: 0.95 }
  237. },
  238. "lambert_cube": {
  239. "type": "MeshLambertMaterial",
  240. "parameters": { color: 0xff6600, envMap: "cube_reflection", combine: "MixOperation", reflectivity: 0.3 }
  241. },
  242. "chrome": {
  243. "type": "MeshLambertMaterial",
  244. "parameters": { color: 0xffffff, envMap: "cube_reflection" }
  245. },
  246. "darkerchrome": {
  247. "type": "MeshLambertMaterial",
  248. "parameters": { color: 0x222222, envMap: "cube_reflection" }
  249. },
  250. "glass": {
  251. "type": "MeshLambertMaterial",
  252. "parameters": { color: 0x101046, envMap: "cube_reflection", opacity: 0.25, transparent: true }
  253. },
  254. "interior": {
  255. "type": "MeshLambertMaterial",
  256. "parameters": { color: 0x050505 }
  257. },
  258. "backlights": {
  259. "type": "MeshLambertMaterial",
  260. "parameters": { color: 0xff0000, opacity: 0.5 }
  261. },
  262. "backsignals": {
  263. "type": "MeshLambertMaterial",
  264. "parameters": { color: 0xffbb00, opacity: 0.5 }
  265. },
  266. "textured_bg": {
  267. "type": "MeshBasicMaterial",
  268. "parameters": { color: 0xffffff, map: "texture_bg" }
  269. },
  270. "minecraft": {
  271. "type": "MeshBasicMaterial",
  272. "parameters": { color: 0xffffff, map: "texture_minecraft" }
  273. },
  274. "face": {
  275. "type": "MeshFaceMaterial",
  276. "parameters": {}
  277. }
  278. },
  279. "textures":
  280. {
  281. "cube_reflection": {
  282. "url": [ "textures/cube/SwedishRoyalCastle/px.jpg",
  283. "textures/cube/SwedishRoyalCastle/nx.jpg",
  284. "textures/cube/SwedishRoyalCastle/py.jpg",
  285. "textures/cube/SwedishRoyalCastle/ny.jpg",
  286. "textures/cube/SwedishRoyalCastle/pz.jpg",
  287. "textures/cube/SwedishRoyalCastle/nz.jpg"
  288. ]
  289. },
  290. "cube_refraction": {
  291. "url": [ "textures/cube/SwedishRoyalCastle/px.jpg",
  292. "textures/cube/SwedishRoyalCastle/nx.jpg",
  293. "textures/cube/SwedishRoyalCastle/py.jpg",
  294. "textures/cube/SwedishRoyalCastle/ny.jpg",
  295. "textures/cube/SwedishRoyalCastle/nz.jpg",
  296. "textures/cube/SwedishRoyalCastle/pz.jpg"
  297. ],
  298. "mapping": "CubeRefractionMapping"
  299. },
  300. "texture_bg": {
  301. "url": "textures/cube/SwedishRoyalCastle/pz.jpg"
  302. },
  303. "texture_minecraft": {
  304. "url": "textures/minecraft/grass.png",
  305. "magFilter": "NearestFilter",
  306. "minFilter": "LinearMipMapLinearFilter"
  307. }
  308. },
  309. "cameras":
  310. {
  311. "cam1": {
  312. "type" : "perspective",
  313. "fov" : 50,
  314. "aspect": 1.33333,
  315. "near" : 1,
  316. "far" : 1000,
  317. "position": [0,0,100],
  318. "target" : [0,0,0]
  319. },
  320. "cam2": {
  321. "type" : "ortho",
  322. "left" : 0,
  323. "right" : 1024,
  324. "top" : 0,
  325. "bottom": 1024,
  326. "near" : 1,
  327. "far" : 1000,
  328. "position": [0,0,0],
  329. "target" : [0,0,0]
  330. }
  331. },
  332. "lights":
  333. {
  334. "light1": {
  335. "type" : "directional",
  336. "direction" : [0,1,1],
  337. "color" : 0xffffff,
  338. "intensity" : 0.8
  339. },
  340. "light2": {
  341. "type" : "point",
  342. "position": [0,0,0],
  343. "color" : 0xffffff
  344. }
  345. },
  346. "fogs":
  347. {
  348. "basic": {
  349. "type" : "linear",
  350. "color": [1,0,0],
  351. "near" : 1,
  352. "far" : 1000
  353. },
  354. "exponential": {
  355. "type" : "exp2",
  356. "color" : [1,1,1],
  357. "density" : 0.005,
  358. },
  359. "black": {
  360. "type" : "exp2",
  361. "color" : [0,0,0],
  362. "density" : 0.005,
  363. }
  364. },
  365. "defaults" :
  366. {
  367. "bgcolor" : [0,0,0],
  368. "bgalpha" : 1,
  369. "camera" : "cam1",
  370. "fog" : "black"
  371. }
  372. };
  373. postMessage( scene );
  374. close();