test_scene.js 14 KB

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