Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       var camera, scene, renderer;
  2.       var light;
  3.       var controls;
  4.  
  5.       function CreateCam_0() {
  6.       // Camera name: lft_cam
  7.          var camera_obj = new THREE.PerspectiveCamera(35, window.innerWidth / window.innerHeight, 15.91092,  134.46671);
  8.          camera_obj.position.x = 49.52760;
  9.          camera_obj.position.y = 0.00000;
  10.          camera_obj.position.z = 0.00000;
  11.          camera_obj.up = new THREE.Vector3(0, 0, 1);
  12.          var target = new THREE.Vector3(0.00000, 0.00000, 0.00000);
  13.          camera_obj.lookAt(target);
  14.          return camera_obj;
  15.       }
  16.       function ChangeCam0(){
  17.          camera = CreateCam_0();
  18.          controls = new THREE.TrackballControls(camera);
  19.          controls.addEventListener('change', render);
  20.       }
  21.       function CreateCam_1() {
  22.       // Camera name: rgt_cam
  23.          var camera_obj = new THREE.PerspectiveCamera(35, window.innerWidth / window.innerHeight, 0.06364,  63.64368);
  24.          camera_obj.position.x = -49.52760;
  25.          camera_obj.position.y = 0.00000;
  26.          camera_obj.position.z = 0.00000;
  27.          camera_obj.up = new THREE.Vector3(0, 0, 1);
  28.          var target = new THREE.Vector3(0.00000, 0.00000, 0.00000);
  29.          camera_obj.lookAt(target);
  30.          return camera_obj;
  31.       }
  32.       function ChangeCam1(){
  33.          camera = CreateCam_1();
  34.          controls = new THREE.TrackballControls(camera);
  35.          controls.addEventListener('change', render);
  36.       }
  37.       function CreateCam_2() {
  38.       // Camera name: frt_cam
  39.          var camera_obj = new THREE.PerspectiveCamera(35, window.innerWidth / window.innerHeight, 26.55863,  142.71144);
  40.          camera_obj.position.x = 0.00000;
  41.          camera_obj.position.y = -62.23650;
  42.          camera_obj.position.z = 0.00000;
  43.          camera_obj.up = new THREE.Vector3(0, 0, 1);
  44.          var target = new THREE.Vector3(0.00000, 0.00000, 0.00000);
  45.          camera_obj.lookAt(target);
  46.          return camera_obj;
  47.       }
  48.       function ChangeCam2(){
  49.          camera = CreateCam_2();
  50.          controls = new THREE.TrackballControls(camera);
  51.          controls.addEventListener('change', render);
  52.       }
  53.       function CreateCam_3() {
  54.       // Camera name: bck_cam
  55.          var camera_obj = new THREE.PerspectiveCamera(35, window.innerWidth / window.innerHeight, 26.55863,  142.71144);
  56.          camera_obj.position.x = 0.00000;
  57.          camera_obj.position.y = 62.23650;
  58.          camera_obj.position.z = 0.00000;
  59.          camera_obj.up = new THREE.Vector3(0, 0, 1);
  60.          var target = new THREE.Vector3(0.00000, 0.00000, 0.00000);
  61.          camera_obj.lookAt(target);
  62.          return camera_obj;
  63.       }
  64.       function ChangeCam3(){
  65.          camera = CreateCam_3();
  66.          controls = new THREE.TrackballControls(camera);
  67.          controls.addEventListener('change', render);
  68.       }
  69.       function CreateCam_4() {
  70.       // Camera name: top_cam
  71.          var camera_obj = new THREE.PerspectiveCamera(35, window.innerWidth / window.innerHeight, 26.55863,  148.66365);
  72.          camera_obj.position.x = 0.00000;
  73.          camera_obj.position.y = 0.00000;
  74.          camera_obj.position.z = 63.72454;
  75.          camera_obj.up = new THREE.Vector3(0, 1, 0);
  76.          var target = new THREE.Vector3(0.00000, 0.00000, 0.00000);
  77.          camera_obj.lookAt(target);
  78.          return camera_obj;
  79.       }
  80.       function ChangeCam4(){
  81.          camera = CreateCam_4();
  82.          controls = new THREE.TrackballControls(camera);
  83.          controls.addEventListener('change', render);
  84.       }
  85.       function CreateCam_5() {
  86.       // Camera name: iso_cam
  87.          var camera_obj = new THREE.PerspectiveCamera(35, window.innerWidth / window.innerHeight, 13.27932,  1859.10425);
  88.          camera_obj.position.x = 44.26439;
  89.          camera_obj.position.y = -35.67786;
  90.          camera_obj.position.z = 37.16591;
  91.          camera_obj.up = new THREE.Vector3(0, 0, 1);
  92.          var target = new THREE.Vector3(0.00000, 0.00000, 0.00000);
  93.          camera_obj.lookAt(target);
  94.          return camera_obj;
  95.       }
  96.       function ChangeCam5(){
  97.          camera = CreateCam_5();
  98.          controls = new THREE.TrackballControls(camera);
  99.          controls.addEventListener('change', render);
  100.       }
  101.  
  102.       init();
  103.       animate();
  104.  
  105.       function init() {
  106.  
  107.          if ( !Detector.webgl ) Detector.addGetWebGLMessage();
  108.  
  109.          renderer = new THREE.WebGLRenderer();
  110.          renderer.setSize(window.innerWidth, window.innerHeight);
  111.          document.body.appendChild(renderer.domElement);
  112.          renderer.setClearColor(0x3CB371, 1);
  113.  
  114.          camera = new THREE.PerspectiveCamera(35, window.innerWidth / window.innerHeight, 13.27932,  1859.10425);
  115.          camera.position.x = 44.26439;
  116.          camera.position.y = -35.67786;
  117.          camera.position.z = 37.16591;
  118.          camera.up = new THREE.Vector3(0, 0, 1);
  119.          var target = new THREE.Vector3(0.00000, 0.00000, 0.00000);
  120.          camera.lookAt(target);
  121.  
  122.          controls = new THREE.TrackballControls(camera);
  123.          controls.addEventListener('change', render);
  124.  
  125.          scene = new THREE.Scene();
  126.  
  127.          var light_ambient = new THREE.AmbientLight(0x000000);
  128.          scene.add(light_ambient);
  129.  
  130.          light = new THREE.PointLight(0x999999);
  131.          light.position.set(26.55863, -35.41151, 53.11727);
  132.          scene.add(light);
  133.          light = new THREE.PointLight(0x4C4C4C);
  134.          light.position.set(-35.41151, -35.41151, 26.55863);
  135.          scene.add(light);
  136.          light = new THREE.PointLight(0x4C4C4C);
  137.          light.position.set(0.00000, 35.41151, 35.41151);
  138.          scene.add(light);
  139.  
  140.  
  141. function create_geometry_0(scene)
  142. {
  143.       var mesh;
  144.       var material;
  145.       var geometry;
  146.       var vertices = new Float32Array([
  147.             3.15576, 1.04922, 10.60728,
  148.             -17.70576, 1.04922, 10.60728,
  149.             -17.70576, -9.11923, 10.60728,
  150.             3.15576, -9.11923, 10.60728,
  151.             3.15576, 1.04922, 10.60728,
  152.             -17.70576, -9.11923, 10.60728,
  153.             3.15576, 1.04922, -4.08228,
  154.             -17.70576, 1.04922, -4.08228,
  155.             -17.70576, 1.04922, 10.60728,
  156.             3.15576, 1.04922, 10.60728,
  157.             3.15576, 1.04922, -4.08228,
  158.             -17.70576, 1.04922, 10.60728,
  159.             3.15576, -9.11923, -4.08228,
  160.             -17.70576, -9.11923, -4.08228,
  161.             -17.70576, 1.04922, -4.08228,
  162.             3.15576, 1.04922, -4.08228,
  163.             3.15576, -9.11923, -4.08228,
  164.             -17.70576, 1.04922, -4.08228,
  165.             3.15576, -9.11923, 10.60728,
  166.             -17.70576, -9.11923, 10.60728,
  167.             -17.70576, -9.11923, -4.08228,
  168.             3.15576, -9.11923, -4.08228,
  169.             3.15576, -9.11923, 10.60728,
  170.             -17.70576, -9.11923, -4.08228,
  171.             3.15576, 1.04922, -4.08228,
  172.             3.15576, 1.04922, 10.60728,
  173.             3.15576, -9.11923, 10.60728,
  174.             3.15576, -9.11923, -4.08228,
  175.             3.15576, 1.04922, -4.08228,
  176.             3.15576, -9.11923, 10.60728,
  177.             -17.70576, 1.04922, 10.60728,
  178.             -17.70576, 1.04922, -4.08228,
  179.             -17.70576, -9.11923, -4.08228,
  180.             -17.70576, -9.11923, 10.60728,
  181.             -17.70576, 1.04922, 10.60728,
  182.             -17.70576, -9.11923, -4.08228,
  183.             11.60575, 9.11922, 8.20728,
  184.             -9.25575, 9.11922, 8.20728,
  185.             -9.25575, -1.04928, 8.20728,
  186.             11.60575, -1.04928, 8.20728,
  187.             11.60575, 9.11922, 8.20728,
  188.             -9.25575, -1.04928, 8.20728,
  189.             11.60575, 9.11922, -6.48228,
  190.             -9.25575, 9.11922, -6.48228,
  191.             -9.25575, 9.11922, 8.20728,
  192.             11.60575, 9.11922, 8.20728,
  193.             11.60575, 9.11922, -6.48228,
  194.             -9.25575, 9.11922, 8.20728,
  195.             11.60575, -1.04928, -6.48228,
  196.             -9.25575, -1.04928, -6.48228,
  197.             -9.25575, 9.11922, -6.48228,
  198.             11.60575, 9.11922, -6.48228,
  199.             11.60575, -1.04928, -6.48228,
  200.             -9.25575, 9.11922, -6.48228,
  201.             11.60575, -1.04928, 8.20728,
  202.             -9.25575, -1.04928, 8.20728,
  203.             -9.25575, -1.04928, -6.48228,
  204.             11.60575, -1.04928, -6.48228,
  205.             11.60575, -1.04928, 8.20728,
  206.             -9.25575, -1.04928, -6.48228,
  207.             11.60575, 9.11922, -6.48228,
  208.             11.60575, 9.11922, 8.20728,
  209.             11.60575, -1.04928, 8.20728,
  210.             11.60575, -1.04928, -6.48228,
  211.             11.60575, 9.11922, -6.48228,
  212.             11.60575, -1.04928, 8.20728,
  213.             -9.25575, 9.11922, 8.20728,
  214.             -9.25575, 9.11922, -6.48228,
  215.             -9.25575, -1.04928, -6.48228,
  216.             -9.25575, -1.04928, 8.20728,
  217.             -9.25575, 9.11922, 8.20728,
  218.             -9.25575, -1.04928, -6.48228,
  219.             17.70576, 1.04922, 4.08228,
  220.             -3.15576, 1.04922, 4.08228,
  221.             -3.15576, -9.11923, 4.08228,
  222.             17.70576, -9.11923, 4.08228,
  223.             17.70576, 1.04922, 4.08228,
  224.             -3.15576, -9.11923, 4.08228,
  225.             17.70576, 1.04922, -10.60728,
  226.             -3.15576, 1.04922, -10.60728,
  227.             -3.15576, 1.04922, 4.08228,
  228.             17.70576, 1.04922, 4.08228,
  229.             17.70576, 1.04922, -10.60728,
  230.             -3.15576, 1.04922, 4.08228,
  231.             17.70576, -9.11923, -10.60728,
  232.             -3.15576, -9.11923, -10.60728,
  233.             -3.15576, 1.04922, -10.60728,
  234.             17.70576, 1.04922, -10.60728,
  235.             17.70576, -9.11923, -10.60728,
  236.             -3.15576, 1.04922, -10.60728,
  237.             17.70576, -9.11923, 4.08228,
  238.             -3.15576, -9.11923, 4.08228,
  239.             -3.15576, -9.11923, -10.60728,
  240.             17.70576, -9.11923, -10.60728,
  241.             17.70576, -9.11923, 4.08228,
  242.             -3.15576, -9.11923, -10.60728,
  243.             17.70576, 1.04922, -10.60728,
  244.             17.70576, 1.04922, 4.08228,
  245.             17.70576, -9.11923, 4.08228,
  246.             17.70576, -9.11923, -10.60728,
  247.             17.70576, 1.04922, -10.60728,
  248.             17.70576, -9.11923, 4.08228,
  249.             -3.15576, 1.04922, 4.08228,
  250.             -3.15576, 1.04922, -10.60728,
  251.             -3.15576, -9.11923, -10.60728,
  252.             -3.15576, -9.11923, 4.08228,
  253.             -3.15576, 1.04922, 4.08228,
  254.                -3.15576, -9.11923, -10.60728
  255.       ]);
  256.       var normals = new Float32Array([
  257.             0.00000, 0.00000, 1.00000,
  258.             -0.00000, 0.00000, 1.00000,
  259.             0.00000, 0.00000, 1.00000,
  260.             0.00000, -0.00000, 1.00000,
  261.             0.00000, 0.00000, 1.00000,
  262.             0.00000, 0.00000, 1.00000,
  263.             0.00000, 1.00000, 0.00000,
  264.             0.00000, 1.00000, 0.00000,
  265.             0.00000, 1.00000, 0.00000,
  266.             0.00000, 1.00000, 0.00000,
  267.             0.00000, 1.00000, -0.00000,
  268.             -0.00000, 1.00000, 0.00000,
  269.             0.00000, 0.00000, -1.00000,
  270.             0.00000, 0.00000, -1.00000,
  271.             0.00000, 0.00000, -1.00000,
  272.             -0.00000, -0.00000, -1.00000,
  273.             0.00000, 0.00000, -1.00000,
  274.             0.00000, 0.00000, -1.00000,
  275.             -0.00000, -1.00000, 0.00000,
  276.             0.00000, -1.00000, 0.00000,
  277.             0.00000, -1.00000, 0.00000,
  278.             0.00000, -1.00000, 0.00000,
  279.             0.00000, -1.00000, -0.00000,
  280.             0.00000, -1.00000, 0.00000,
  281.             1.00000, 0.00000, -0.00000,
  282.             1.00000, 0.00000, 0.00000,
  283.             1.00000, -0.00000, 0.00000,
  284.             1.00000, 0.00000, 0.00000,
  285.             1.00000, 0.00000, 0.00000,
  286.             1.00000, 0.00000, 0.00000,
  287.             -1.00000, 0.00000, -0.00000,
  288.             -1.00000, 0.00000, 0.00000,
  289.             -1.00000, 0.00000, 0.00000,
  290.             -1.00000, 0.00000, 0.00000,
  291.             -1.00000, -0.00000, 0.00000,
  292.             -1.00000, 0.00000, 0.00000,
  293.             0.00000, 0.00000, 1.00000,
  294.             -0.00000, 0.00000, 1.00000,
  295.             0.00000, 0.00000, 1.00000,
  296.             0.00000, -0.00000, 1.00000,
  297.             0.00000, 0.00000, 1.00000,
  298.             0.00000, 0.00000, 1.00000,
  299.             0.00000, 1.00000, 0.00000,
  300.             0.00000, 1.00000, 0.00000,
  301.             0.00000, 1.00000, 0.00000,
  302.             0.00000, 1.00000, 0.00000,
  303.             0.00000, 1.00000, -0.00000,
  304.             -0.00000, 1.00000, 0.00000,
  305.             0.00000, 0.00000, -1.00000,
  306.             0.00000, 0.00000, -1.00000,
  307.             0.00000, 0.00000, -1.00000,
  308.             -0.00000, -0.00000, -1.00000,
  309.             0.00000, 0.00000, -1.00000,
  310.             0.00000, 0.00000, -1.00000,
  311.             -0.00000, -1.00000, 0.00000,
  312.             0.00000, -1.00000, 0.00000,
  313.             0.00000, -1.00000, 0.00000,
  314.             0.00000, -1.00000, 0.00000,
  315.             0.00000, -1.00000, -0.00000,
  316.             0.00000, -1.00000, 0.00000,
  317.             1.00000, 0.00000, -0.00000,
  318.             1.00000, 0.00000, 0.00000,
  319.             1.00000, -0.00000, 0.00000,
  320.             1.00000, 0.00000, 0.00000,
  321.             1.00000, 0.00000, 0.00000,
  322.             1.00000, 0.00000, 0.00000,
  323.             -1.00000, 0.00000, -0.00000,
  324.             -1.00000, 0.00000, 0.00000,
  325.             -1.00000, 0.00000, 0.00000,
  326.             -1.00000, 0.00000, 0.00000,
  327.             -1.00000, -0.00000, 0.00000,
  328.             -1.00000, 0.00000, 0.00000,
  329.             0.00000, 0.00000, 1.00000,
  330.             -0.00000, 0.00000, 1.00000,
  331.             0.00000, 0.00000, 1.00000,
  332.             0.00000, -0.00000, 1.00000,
  333.             0.00000, 0.00000, 1.00000,
  334.             0.00000, 0.00000, 1.00000,
  335.             0.00000, 1.00000, 0.00000,
  336.             0.00000, 1.00000, 0.00000,
  337.             0.00000, 1.00000, 0.00000,
  338.             0.00000, 1.00000, 0.00000,
  339.             0.00000, 1.00000, -0.00000,
  340.             -0.00000, 1.00000, 0.00000,
  341.             0.00000, 0.00000, -1.00000,
  342.             0.00000, 0.00000, -1.00000,
  343.             0.00000, 0.00000, -1.00000,
  344.             -0.00000, -0.00000, -1.00000,
  345.             0.00000, 0.00000, -1.00000,
  346.             0.00000, 0.00000, -1.00000,
  347.             -0.00000, -1.00000, 0.00000,
  348.             0.00000, -1.00000, 0.00000,
  349.             0.00000, -1.00000, 0.00000,
  350.             0.00000, -1.00000, 0.00000,
  351.             0.00000, -1.00000, -0.00000,
  352.             0.00000, -1.00000, 0.00000,
  353.             1.00000, 0.00000, -0.00000,
  354.             1.00000, 0.00000, 0.00000,
  355.             1.00000, -0.00000, 0.00000,
  356.             1.00000, 0.00000, 0.00000,
  357.             1.00000, 0.00000, 0.00000,
  358.             1.00000, 0.00000, 0.00000,
  359.             -1.00000, 0.00000, -0.00000,
  360.             -1.00000, 0.00000, 0.00000,
  361.             -1.00000, 0.00000, 0.00000,
  362.             -1.00000, 0.00000, 0.00000,
  363.             -1.00000, -0.00000, 0.00000,
  364.                -1.00000, 0.00000, 0.00000
  365.       ]);
  366.          geometry = new THREE.BufferGeometry();
  367.          geometry.addAttribute('position', new THREE.BufferAttribute(vertices, 3));
  368.          geometry.addAttribute('normal', new THREE.BufferAttribute(normals, 3));
  369.  
  370.          /* Enable to add texture
  371.             var texture = new THREE.TextureLoader().load(  "/PATH/TO/YOUR-TEXTURE.jpg");
  372.             texture.wrapS = THREE.RepeatWrapping;
  373.             texture.wrapT = THREE.RepeatWrapping;
  374.             texture.anisotropy = 8;
  375.          */
  376.          material = new THREE.MeshPhongMaterial({
  377.             color: 0x969696,
  378.             shininess: 2.00000,
  379.             side: THREE.DoubleSide,
  380.             specular: 0x000000
  381.             /* map: texture */
  382.             });
  383.             /* Enable to add texture
  384.             material.map.minFilter = THREE.LinearMipMapLinearFilter;
  385.             material.map.magFilter = THREE.LinearFilter;
  386.             */
  387.          mesh = new THREE.Mesh(geometry, material);
  388.          mesh.receiveShadow = true;
  389.          mesh.castShadow = true;
  390.          scene.add(mesh);
  391.  
  392. }
  393.          create_geometry_0(scene);
  394.  
  395.          window.addEventListener('resize', onWindowResize, false);
  396.       }
  397.  
  398.       function onWindowResize() {
  399.  
  400.          camera.aspect = window.innerWidth / window.innerHeight;
  401.          camera.updateProjectionMatrix();
  402.  
  403.          renderer.setSize(window.innerWidth, window.innerHeight);
  404.  
  405.          controls.handleResize();
  406.          render();
  407.       }
  408.  
  409.       function animate()
  410.       {
  411.          requestAnimationFrame(animate);
  412.          renderer.render(scene, camera);
  413.          controls.update();
  414.       }
  415.  
  416.       function render()
  417.       {
  418.          renderer.render(scene, camera);
  419.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement