three.js

How can we draw 3D bulding structure from existing image Jquery,Css?

蹲街弑〆低调 提交于 2020-06-26 12:11:46
问题 Please see this site it was made in flash: Can we do it by jquery css? Go here And click on any building marked with "Release" You will see one building on hover animation effect. That i want to develop using jquery and css Or you can suggest for development 回答1: First you need to know there is nothing 3d here. These are pre-rendered images. You draw these highlighted areas in a software as different layer, photoshop for example. Then you need create an area that can detect mouse hover. The

Three.js: Correct way to setIndex / indices for BufferGeometry?

梦想与她 提交于 2020-06-25 21:11:33
问题 I'm trying to set per-face UV indices in a BufferGeometry. I'm starting with a Geometry. Each face of my geometry has a face.materialIndex corresponding to a UV index. I'm trying to convert this to a BufferGeometry, and then map over the face.materialIndex to the BufferGeometry . Here's what I have so far: // Convert geometry > buffergeometry const bufGeo = new BufferGeometry().fromGeometry( geometry ); // Get an array of all the original geometry's indices... const faceIndices = geometry

Three.js get the 4 corner coordinates of a cube?

喜夏-厌秋 提交于 2020-06-25 21:10:22
问题 How do I get the 4 coordinates for the corners of a cube? 回答1: If you are using the CubeGeometry (width, height, depth) and you positioned the cube somewhere, then your eight corners are at position.x + width/2, position.y + height/2, position.z + depth/2 position.x + width/2, position.y + height/2, position.z - depth/2 position.x + width/2, position.y - height/2, position.z + depth/2 position.x + width/2, position.y - height/2, position.z - depth/2 position.x - width/2, position.y + height/2

adding click event listener for a cube in 3js

百般思念 提交于 2020-06-25 21:02:26
问题 In my code I have two cubes, I want to add click event listener to them. for example alerting on which cube the user clicked. When I added the click event listener to the document it was worked perfectly, but when I added the same click event listener to the cube it isn't showing anything. Here is my part of code.. <script type = "text/javascript" src = "three.min.js"></script> <script type="text/javascript"> var camera = new THREE.PerspectiveCamera(70,window.innerWidth/window.innerHeight,0.1

adding click event listener for a cube in 3js

谁说胖子不能爱 提交于 2020-06-25 21:02:16
问题 In my code I have two cubes, I want to add click event listener to them. for example alerting on which cube the user clicked. When I added the click event listener to the document it was worked perfectly, but when I added the same click event listener to the cube it isn't showing anything. Here is my part of code.. <script type = "text/javascript" src = "three.min.js"></script> <script type="text/javascript"> var camera = new THREE.PerspectiveCamera(70,window.innerWidth/window.innerHeight,0.1

Raycast in Three.js with only a projection matrix

依然范特西╮ 提交于 2020-06-24 11:36:12
问题 I'm rendering some custom layers using Three.js in a Mapbox GL JS page following this example. I'd like to add raycasting to determine which object a user has clicked on. The issue is that I only get a projection matrix from Mapbox, which I use to render the scene: class CustomLayer { type = 'custom'; renderingMode = '3d'; onAdd(map, gl) { this.map = map; this.camera = new THREE.Camera(); this.renderer = new THREE.WebGLRenderer({ canvas: map.getCanvas(), context: gl, antialias: true, }); this

Showing Depth in Three.js Point Cloud

那年仲夏 提交于 2020-06-23 12:14:03
问题 I have a 3D scan of a rock that I have represented as a point cloud using Three.js, and I wanted to more explicitly show the features of the rock, perhaps using lighting to show depths with Three. Viewing the rock from the top, I see this: When looking closely from the side, you can see rigid features that I would like to show more closely: I am unsure in how to approach this, and was hoping for some help in showing these rock features within this visualization. For context, this is my

Showing Depth in Three.js Point Cloud

大憨熊 提交于 2020-06-23 12:12:54
问题 I have a 3D scan of a rock that I have represented as a point cloud using Three.js, and I wanted to more explicitly show the features of the rock, perhaps using lighting to show depths with Three. Viewing the rock from the top, I see this: When looking closely from the side, you can see rigid features that I would like to show more closely: I am unsure in how to approach this, and was hoping for some help in showing these rock features within this visualization. For context, this is my

Uncaught TypeError: THREE.GLTFLoader is not a constructor

一曲冷凌霜 提交于 2020-06-23 03:30:16
问题 I am new to THREE js I can't figure out the error when I am run my code the following error is showing Uncaught TypeError: THREE.GLTFLoader is not a constructor var loader = new THREE.GLTFLoader(); loader.load('modelReq/Gully_update_2.gltf', function (gltf) { scene.add(gltf.scene); gltf.animations; gltf.scene; gltf.scenes; gltf.cameras; gltf.asset; }, function (xhr) { console.log((xhr.loaded / xhr.total * 100 ) + '% loaded' ); }, function (error) { console.log( 'An error happened = ', error )

I try to use the answer about recursion to draw a depth of 3 and 3 branches per tree,but answer is very strange?

半世苍凉 提交于 2020-06-17 09:36:27
问题 I according the answer from use recursion to draw the tree and use recursion try to draw a depth of 3 and 3 branches per(like picture one) but it print a strange answer (like picture three) Please tell me where is the problem.THANK YOU. picture one: picture two: I use for to draw the answer const tree = [ [0, 0, 0 ], // A // root [-2, 104, -4 ], //B [-39, 189, -23],//c [-4, 230, 19 ], //D [34, 192, -61 ], //E [-150, 270, -72], //F [-115, 296, -63], //G [-106, 326, 6], //G [-82, 365, 23 ],//I