test_scene.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. {
  2. "metadata": {
  3. "formatVersion": 3,
  4. "type" : "scene"
  5. },
  6. "urlBaseType" : "relativeToHTML",
  7. "objects": {
  8. "cube1" : {
  9. "geometry" : "cubeNormals",
  10. "materials": [ "phong_red" ],
  11. "position" : [ 0, 0, 0 ],
  12. "rotation" : [ 0, -0.3, 0 ],
  13. "scale" : [ 1, 1, 1 ],
  14. "visible" : true,
  15. "properties" : {
  16. "rotating" : true
  17. }
  18. },
  19. "cube2" : {
  20. "geometry" : "cubeWire",
  21. "materials": [ "basic_white" ],
  22. "position" : [ 0, 0, 0 ],
  23. "rotation" : [ 0, -0.3, 0 ],
  24. "scale" : [ 2, 2, 2 ],
  25. "visible" : true
  26. },
  27. "cube3" : {
  28. "geometry" : "cube",
  29. "materials": [ "minecraft" ],
  30. "position" : [ -30, -5, 25 ],
  31. "rotation" : [ 0, 0.8, 0 ],
  32. "scale" : [ 1, 1, 1 ],
  33. "visible" : true,
  34. "children" : {
  35. }
  36. },
  37. "sphere_lambert" : {
  38. "geometry" : "sphere",
  39. "materials": [ "lambert_green" ],
  40. "position" : [ -20, -5, 15 ],
  41. "rotation" : [ 0, 0, 0 ],
  42. "scale" : [ 1, 1, 1 ],
  43. "visible" : true
  44. },
  45. "sphere_refraction" : {
  46. "geometry" : "sphere",
  47. "materials": [ "basic_refraction" ],
  48. "position" : [ 50, 45, -50 ],
  49. "rotation" : [ 0, 0, 0 ],
  50. "scale" : [ 1, 1, 1 ],
  51. "visible" : true
  52. },
  53. "icosahedron" : {
  54. "geometry" : "icosahedron",
  55. "materials": [ "faceted_white" ],
  56. "position" : [ 20, 10, -60 ],
  57. "rotation" : [ 0, 0, 0 ],
  58. "scale" : [ 1, 1, 1 ],
  59. "visible" : true
  60. },
  61. "torus" : {
  62. "geometry" : "torus",
  63. "materials": [ "phong_orange" ],
  64. "position" : [ -20, 5, -50 ],
  65. "rotation" : [ 0, 0, 0 ],
  66. "scale" : [ 2, 2, 2 ],
  67. "visible" : true
  68. },
  69. "cone" : {
  70. "geometry" : "cone",
  71. "materials": [ "lambert_blue" ],
  72. "position" : [ -50, 15, -50 ],
  73. "rotation" : [ 0, 0, 0 ],
  74. "scale" : [ 1, 1, 1 ],
  75. "visible" : true
  76. },
  77. "cylinder" : {
  78. "geometry" : "cylinder",
  79. "materials": [ "lambert_blue" ],
  80. "position" : [ 50, 15, -50 ],
  81. "rotation" : [ 0, 0, 0 ],
  82. "scale" : [ 1, 1, 1 ],
  83. "visible" : true
  84. },
  85. "colorcube1" : {
  86. "geometry" : "colorcube",
  87. "materials": [],
  88. "position" : [ -10, -5, 30 ],
  89. "rotation" : [ 0, 0, 0 ],
  90. "scale" : [ 5, 5, 5 ],
  91. "visible" : true,
  92. "children" : {
  93. "colorcube2" : {
  94. "geometry" : "colorcube",
  95. "materials": [],
  96. "position" : [ 0, 2, 0 ],
  97. "rotation" : [ 0.1, 0.1, 0.1 ],
  98. "scale" : [ 0.5, 0.5, 0.5 ],
  99. "visible" : true,
  100. "children" : {
  101. "colorcube3" : {
  102. "geometry" : "colorcube",
  103. "materials": [],
  104. "position" : [ 0, 2, 0 ],
  105. "rotation" : [ 0.1, 0.1, 0.1 ],
  106. "scale" : [ 0.5, 0.5, 0.5 ],
  107. "visible" : true,
  108. "children" : {
  109. "colorcube4" : {
  110. "geometry" : "colorcube",
  111. "materials": [],
  112. "position" : [ 0, 2, 0 ],
  113. "rotation" : [ 0.1, 0.1, 0.1 ],
  114. "scale" : [ 0.5, 0.5, 0.5 ],
  115. "visible" : true
  116. }
  117. }
  118. }
  119. }
  120. }
  121. }
  122. },
  123. "veyron" : {
  124. "geometry" : "veyron",
  125. "materials": [ "face" ],
  126. "position" : [ 40, -1, 0 ],
  127. "rotation" : [ 0, 0.3, 0 ],
  128. "scale" : [ 0.25, 0.25, 0.25 ],
  129. "visible" : true
  130. },
  131. "walt" : {
  132. "geometry" : "WaltHead",
  133. "materials": [ "lambert_cube" ],
  134. "position" : [ -75, 10, -30 ],
  135. "rotation" : [ 0, 0.5, 0 ],
  136. "scale" : [ 0.5, 0.5, 0.5 ],
  137. "visible" : true
  138. },
  139. "ben" : {
  140. "geometry" : "ben",
  141. "materials": [ "phong_ben" ],
  142. "position" : [ -45, -10, 0 ],
  143. "rotation" : [ 0, 0.5, 0 ],
  144. "scale" : [ 55, 55, 55 ],
  145. "visible" : true
  146. },
  147. "ninja" : {
  148. "geometry" : "NinjaLo",
  149. "materials": [ "phong_normal" ],
  150. "position" : [ 75, 10, -30 ],
  151. "rotation" : [ 0, -0.5, 0 ],
  152. "scale" : [ 1.25, 1.25, 1.25 ],
  153. "visible" : true
  154. },
  155. "quad_bg" : {
  156. "geometry" : "quad",
  157. "materials": [ "textured_bg" ],
  158. "position" : [ 0, 15, -90 ],
  159. "rotation" : [ 0, 0, 0 ],
  160. "scale" : [ 20, 20, 20 ],
  161. "visible" : true
  162. },
  163. "ground" : {
  164. "geometry" : "plane",
  165. "materials": [ "basic_gray" ],
  166. "position" : [ 0, -10, 0 ],
  167. "rotation" : [ -1.57, 0, 0 ],
  168. "scale" : [ 100, 100, 100 ],
  169. "visible" : true
  170. }
  171. },
  172. "geometries": {
  173. "cube": {
  174. "type" : "cube",
  175. "width" : 10,
  176. "height": 10,
  177. "depth" : 10,
  178. "segmentsWidth" : 1,
  179. "segmentsHeight" : 1,
  180. "segmentsDepth" : 1,
  181. "flipped" : false,
  182. "sides" : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
  183. },
  184. "cubeNormals": {
  185. "type" : "cube",
  186. "width" : 10,
  187. "height": 10,
  188. "depth" : 10,
  189. "segmentsWidth" : 1,
  190. "segmentsHeight" : 1,
  191. "segmentsDepth" : 1,
  192. "flipped" : false,
  193. "sides" : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
  194. },
  195. "cubeWire": {
  196. "type" : "cube",
  197. "width" : 10,
  198. "height": 10,
  199. "depth" : 10,
  200. "segmentsWidth" : 1,
  201. "segmentsHeight" : 1,
  202. "segmentsDepth" : 1,
  203. "flipped" : false,
  204. "sides" : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
  205. },
  206. "plane": {
  207. "type" : "plane",
  208. "width" : 10,
  209. "height" : 10,
  210. "segmentsWidth" : 50,
  211. "segmentsHeight" : 50
  212. },
  213. "quad": {
  214. "type" : "plane",
  215. "width" : 10,
  216. "height" : 10,
  217. "segmentsWidth" : 1,
  218. "segmentsHeight" : 1
  219. },
  220. "sphere": {
  221. "type" : "sphere",
  222. "radius" : 5,
  223. "segmentsWidth" : 32,
  224. "segmentsHeight" : 16
  225. },
  226. "icosahedron": {
  227. "type" : "icosahedron",
  228. "radius" : 20,
  229. "subdivisions" : 2
  230. },
  231. "torus": {
  232. "type" : "torus",
  233. "radius" : 5,
  234. "tube" : 2,
  235. "segmentsR" : 16,
  236. "segmentsT" : 32
  237. },
  238. "cylinder": {
  239. "type" : "cylinder",
  240. "topRad" : 5,
  241. "botRad" : 5,
  242. "height" : 50,
  243. "radSegs" : 32,
  244. "heightSegs": 1
  245. },
  246. "cone": {
  247. "type" : "cylinder",
  248. "topRad" : 0,
  249. "botRad" : 5,
  250. "height" : 50,
  251. "radSegs" : 32,
  252. "heightSegs" : 1
  253. },
  254. "WaltHead": {
  255. "type": "bin_mesh",
  256. "url" : "obj/walt/WaltHead_bin.js"
  257. },
  258. "NinjaLo": {
  259. "type": "bin_mesh",
  260. "url" : "obj/ninja/NinjaLo_bin.js"
  261. },
  262. "veyron": {
  263. "type": "bin_mesh",
  264. "url" : "obj/veyron/VeyronNoUv_bin.js"
  265. },
  266. "ben": {
  267. "type": "ctm_mesh",
  268. "url" : "models/ctm/ben.ctm",
  269. "useWorkers" : true,
  270. "useBuffers" : true
  271. },
  272. "colorcube": {
  273. "type": "embedded_mesh",
  274. "id" : "cube_fvc"
  275. }
  276. },
  277. "embeds": {
  278. "cube_fvc": {
  279. "metadata" : {
  280. "formatVersion" : 3
  281. },
  282. "scale" : 1.0,
  283. "materials": [{
  284. "DbgColor" : 15658734,
  285. "DbgIndex" : 0,
  286. "DbgName" : "Material",
  287. "colorAmbient" : [0.0, 0.0, 0.0],
  288. "colorDiffuse" : [0.8, 0.8, 0.8],
  289. "colorSpecular" : [0.5, 0.5, 0.5],
  290. "specularCoef" : 50,
  291. "transparency" : 1.0,
  292. "vertexColors" : true
  293. }],
  294. "vertices": [1.000000,-1.000000,-1.000000,1.000000,-1.000000,1.000000,-1.000000,-1.000000,1.000000,-1.000000,-1.000000,-1.000000,1.000000,1.000000,-1.000000,0.999999,1.000000,1.000001,-1.000000,1.000000,1.000000,-1.000000,1.000000,-1.000000],
  295. "morphTargets": [],
  296. "normals": [],
  297. "colors": [16777215,16769421,16769424,8454135,15195931,7299839,16586715,16711687,1056014,6029475,13762484,9044089,7962349,6772991,16774622,4144383,11973887,1966063,1056285,9081232,13696943,5002581],
  298. "uvs": [[]],
  299. "faces": [131,0,1,2,3,0,0,1,2,3,131,4,7,6,5,0,4,5,6,7,131,0,4,5,1,0,0,8,9,10,131,1,5,6,2,0,0,11,12,13,131,2,6,7,3,0,14,15,16,17,131,4,0,3,7,0,18,19,20,21]
  300. }
  301. },
  302. "materials": {
  303. "basic_gray": {
  304. "type": "MeshBasicMaterial",
  305. "parameters": { "color": 6710886, "wireframe": true }
  306. },
  307. "basic_white": {
  308. "type": "MeshBasicMaterial",
  309. "parameters": { "color": 16777215, "wireframe": true }
  310. },
  311. "faceted_white": {
  312. "type": "MeshLambertMaterial",
  313. "parameters": { "color": 16777215, "shading": "flat" }
  314. },
  315. "phong_red": {
  316. "type": "MeshPhongMaterial",
  317. "parameters": { "color": 16711680, "specular": 16711680, "shininess": 25, "bumpMap": "texture_bump", "bumpScale": -0.75 }
  318. },
  319. "phong_ben": {
  320. "type": "MeshPhongMaterial",
  321. "parameters": { "color": 1118481, "ambient": 1118481, "specular": 5601245, "shininess": 12, "bumpMap": "texture_bump_repeat", "bumpScale": 0.125, "envMaps": "cube_reflection", "reflectivity": 0.5 }
  322. },
  323. "phong_normal": {
  324. "type": "MeshPhongMaterial",
  325. "parameters": { "color": 0, "specular": 16777215, "shininess": 25, "envMap": "cube_reflection", "reflectivity": 0.1, "lightMap": "texture_ao", "normalMap": "texture_normal", "normalScale": [ 1, -1 ], "displacementMap": "texture_displacement", "displacementScale": 2.436143, "displacementBias": -0.428408 }
  326. },
  327. "lambert_green": {
  328. "type": "MeshLambertMaterial",
  329. "parameters": { "color": 30481, "blending": "AdditiveBlending", "transparent": true }
  330. },
  331. "lambert_blue": {
  332. "type": "MeshLambertMaterial",
  333. "parameters": { "color": 21930 }
  334. },
  335. "phong_orange": {
  336. "type": "MeshPhongMaterial",
  337. "parameters": { "color": 0, "specular": 11162880 }
  338. },
  339. "basic_refraction": {
  340. "type": "MeshBasicMaterial",
  341. "parameters": { "color": 16777215, "envMap": "cube_refraction", "refractionRatio": 0.95 }
  342. },
  343. "lambert_cube": {
  344. "type": "MeshLambertMaterial",
  345. "parameters": { "color": 16737792, "envMap": "cube_reflection", "combine": "MixOperation", "reflectivity": 0.3 }
  346. },
  347. "chrome": {
  348. "type": "MeshLambertMaterial",
  349. "parameters": { "color": 16777215, "envMap": "cube_reflection" }
  350. },
  351. "darkerchrome": {
  352. "type": "MeshLambertMaterial",
  353. "parameters": { "color": 2236962, "envMap": "cube_reflection" }
  354. },
  355. "glass": {
  356. "type": "MeshLambertMaterial",
  357. "parameters": { "color": 1052742, "envMap": "cube_reflection", "opacity": 0.25, "transparent": true }
  358. },
  359. "interior": {
  360. "type": "MeshLambertMaterial",
  361. "parameters": { "color": 328965 }
  362. },
  363. "backlights": {
  364. "type": "MeshLambertMaterial",
  365. "parameters": { "color": 16711680, "opacity": 0.5 }
  366. },
  367. "backsignals": {
  368. "type": "MeshLambertMaterial",
  369. "parameters": { "color": 16759552, "opacity": 0.5 }
  370. },
  371. "textured_bg": {
  372. "type": "MeshBasicMaterial",
  373. "parameters": { "color": 16777215, "map": "texture_bg" }
  374. },
  375. "minecraft": {
  376. "type": "MeshBasicMaterial",
  377. "parameters": { "color": 16777215, "map": "texture_minecraft" }
  378. },
  379. "face": {
  380. "type": "MeshFaceMaterial",
  381. "parameters": {}
  382. }
  383. },
  384. "textures": {
  385. "cube_reflection": {
  386. "url": [ "textures/cube/SwedishRoyalCastle/px.jpg",
  387. "textures/cube/SwedishRoyalCastle/nx.jpg",
  388. "textures/cube/SwedishRoyalCastle/py.jpg",
  389. "textures/cube/SwedishRoyalCastle/ny.jpg",
  390. "textures/cube/SwedishRoyalCastle/pz.jpg",
  391. "textures/cube/SwedishRoyalCastle/nz.jpg"
  392. ]
  393. },
  394. "cube_refraction": {
  395. "url": [ "textures/cube/SwedishRoyalCastle/px.jpg",
  396. "textures/cube/SwedishRoyalCastle/nx.jpg",
  397. "textures/cube/SwedishRoyalCastle/py.jpg",
  398. "textures/cube/SwedishRoyalCastle/ny.jpg",
  399. "textures/cube/SwedishRoyalCastle/nz.jpg",
  400. "textures/cube/SwedishRoyalCastle/pz.jpg"
  401. ],
  402. "mapping": "CubeRefractionMapping"
  403. },
  404. "texture_bg": {
  405. "url": "textures/cube/SwedishRoyalCastle/pz.jpg",
  406. "anisotropy": 4
  407. },
  408. "texture_bump": {
  409. "url": "textures/water.jpg",
  410. "anisotropy": 4
  411. },
  412. "texture_bump_repeat": {
  413. "url": "textures/water.jpg",
  414. "repeat" : [ 20, 20 ],
  415. "anisotropy": 4
  416. },
  417. "texture_normal": {
  418. "url": "textures/normal/ninja/normal.jpg",
  419. "anisotropy": 4
  420. },
  421. "texture_ao": {
  422. "url": "textures/normal/ninja/ao.jpg",
  423. "anisotropy": 4
  424. },
  425. "texture_displacement": {
  426. "url": "textures/normal/ninja/displacement.jpg",
  427. "anisotropy": 4
  428. },
  429. "texture_minecraft": {
  430. "url": "textures/minecraft/grass.png",
  431. "magFilter": "NearestFilter",
  432. "minFilter": "LinearMipMapLinearFilter"
  433. }
  434. },
  435. "cameras": {
  436. "cam1": {
  437. "type" : "perspective",
  438. "fov" : 50,
  439. "aspect": 1.33333,
  440. "near" : 1,
  441. "far" : 1000,
  442. "position": [0,0,100],
  443. "target" : [0,0,0]
  444. },
  445. "cam2": {
  446. "type" : "ortho",
  447. "left" : 0,
  448. "right" : 1024,
  449. "top" : 0,
  450. "bottom": 1024,
  451. "near" : 1,
  452. "far" : 1000,
  453. "position": [0,0,0],
  454. "target" : [0,0,0]
  455. }
  456. },
  457. "lights": {
  458. "light1": {
  459. "type" : "directional",
  460. "direction" : [0,1,1],
  461. "color" : 16777215,
  462. "intensity" : 1
  463. },
  464. "light2": {
  465. "type" : "point",
  466. "position": [0,0,0],
  467. "color" : 16777215,
  468. "intensity" : 1.25
  469. }
  470. },
  471. "fogs": {
  472. "basic": {
  473. "type": "linear",
  474. "color": [1,0,0],
  475. "near": 1,
  476. "far": 1000
  477. },
  478. "exponential": {
  479. "type": "exp2",
  480. "color": [1,1,1],
  481. "density": 0.005
  482. },
  483. "black": {
  484. "type": "exp2",
  485. "color": [0,0,0],
  486. "density": 0.005
  487. }
  488. },
  489. "defaults": {
  490. "bgcolor": [0,0,0],
  491. "bgalpha": 1,
  492. "camera": "cam1",
  493. "fog": "black"
  494. }
  495. }