three.js

have no light on my three.js scene

我与影子孤独终老i 提交于 2020-02-24 00:41:03
问题 i have a problem. i have wrote some code on three.js, it consists of scene, 2 objects, renderer and camera. but when i added the light i didnt see the it! i tried some options..but nothing helped me my code there - http://codepen.io/usf/pen/LaDwh var light = new THREE.SpotLight(0xff0000); light.position.set( 0, 0, 50 ); var pointLight = new THREE.PointLight( 0xffffff); pointLight.position.set( 0, 0, 50 ); scene.add(light); scene.add(pointLight); //code renderer.render(scene, camera); i dont

have no light on my three.js scene

生来就可爱ヽ(ⅴ<●) 提交于 2020-02-24 00:39:17
问题 i have a problem. i have wrote some code on three.js, it consists of scene, 2 objects, renderer and camera. but when i added the light i didnt see the it! i tried some options..but nothing helped me my code there - http://codepen.io/usf/pen/LaDwh var light = new THREE.SpotLight(0xff0000); light.position.set( 0, 0, 50 ); var pointLight = new THREE.PointLight( 0xffffff); pointLight.position.set( 0, 0, 50 ); scene.add(light); scene.add(pointLight); //code renderer.render(scene, camera); i dont

In Forge Viewer Autodesk v7 LineDashMaterial and color for LineBasicMaterial not working

走远了吗. 提交于 2020-02-23 07:06:11
问题 I am trying to add Lines of two different material i.e. LineDashedMaterial and LineBasicMaterial using Three.js in Forge viewer v7. LineDashedMaterial not showing dashed pattern and material color in scene and sceneAfter but working in overlays scene same for LineBasicMaterial. but my requirement is to add line in scene and sceneAfter. can anyone tell me solution for this. thanks in advance. let geometry = new THREE.Geometry(); geometry.vertices.push(new THREE.Vector3(0, 0, 0), new THREE

A-frame move forward in camera direction

為{幸葍}努か 提交于 2020-02-23 04:36:05
问题 I'm trying to make a component in A-frame that will move the player/camera in the direction the camera is facing. It should not move anywhere on the y plane, only in the x/y plane. The current setup in the dom is: <a-entity> <a-camera></a-camera> </a-entity> I want to move the entity element position to x units in the current camera direction but it should not move anything on the y-plane. I have tried various solutions but they seem to introduce some weird shift in the camera. 回答1: You could

ThreeJS orbit controls set target without lookAt

风格不统一 提交于 2020-02-22 04:28:42
问题 I am trying to make a 3D viewer for building models. We have the model loaded and are trying to make some sort of interaction with the model. Therefor we are using OrbiControls for rotating, panning and zooming the model. We want to have the behaviour in the viewer that when a user clicks and drags (thus rotating), the rotation center is at the point of the building where the user clicks. I thought I was wise by changing the target of the OrbitControl as such: control.target.set(newX, newY,

ThreeJS orbit controls set target without lookAt

喜你入骨 提交于 2020-02-22 04:21:59
问题 I am trying to make a 3D viewer for building models. We have the model loaded and are trying to make some sort of interaction with the model. Therefor we are using OrbiControls for rotating, panning and zooming the model. We want to have the behaviour in the viewer that when a user clicks and drags (thus rotating), the rotation center is at the point of the building where the user clicks. I thought I was wise by changing the target of the OrbitControl as such: control.target.set(newX, newY,

ThreeJS orbit controls set target without lookAt

放肆的年华 提交于 2020-02-22 04:21:51
问题 I am trying to make a 3D viewer for building models. We have the model loaded and are trying to make some sort of interaction with the model. Therefor we are using OrbiControls for rotating, panning and zooming the model. We want to have the behaviour in the viewer that when a user clicks and drags (thus rotating), the rotation center is at the point of the building where the user clicks. I thought I was wise by changing the target of the OrbitControl as such: control.target.set(newX, newY,

ThreeJS orbit controls set target without lookAt

非 Y 不嫁゛ 提交于 2020-02-22 04:21:31
问题 I am trying to make a 3D viewer for building models. We have the model loaded and are trying to make some sort of interaction with the model. Therefor we are using OrbiControls for rotating, panning and zooming the model. We want to have the behaviour in the viewer that when a user clicks and drags (thus rotating), the rotation center is at the point of the building where the user clicks. I thought I was wise by changing the target of the OrbitControl as such: control.target.set(newX, newY,

ThreeJS orbit controls set target without lookAt

和自甴很熟 提交于 2020-02-22 04:20:12
问题 I am trying to make a 3D viewer for building models. We have the model loaded and are trying to make some sort of interaction with the model. Therefor we are using OrbiControls for rotating, panning and zooming the model. We want to have the behaviour in the viewer that when a user clicks and drags (thus rotating), the rotation center is at the point of the building where the user clicks. I thought I was wise by changing the target of the OrbitControl as such: control.target.set(newX, newY,

Preloading Obj+Mtl Objects in Three.js

旧城冷巷雨未停 提交于 2020-02-08 07:01:52
问题 I need to preload some obj+mtl files with Three.js (It's not the same file) and I need call another function when all the objects have been loaded. I tried putting a boolean variable that changes when every obj has been loaded and doing a function that confirms if all the objects have been loaded but it didn't work, for some reason the page crash. I have all the obj and mtl paths in an array. This is an example of what I'm doing. http://pastie.org/10297027 I tried to put the load function in