three.js

three.js: Weird Rotation of child objects

喜欢而已 提交于 2020-01-16 18:42:32
问题 I'm trying to implement an experimental version of a 2x2x2 Rubiks Cube. I have adopted instructions from two previous posts with issues regarding child objects attachment and detachment: Three.js: Proper way to add and remove child objects using THREE.SceneUtils.attach/detach functions and Three.js: Adding and Removing Children of Rotated Objects and have been able to successfully understand how to rotate two faces independently. However, when I implement the same in code, I get weird results

How can you add text to the Forge Viewer with three.js?

不羁岁月 提交于 2020-01-16 11:11:06
问题 So, I am trying to add TextGeometry to the viewer with Three.js. I am wondering if it is possible to do this, and how you would go about doing it. I have looked on the docs, but none of their solutions seem to be working since the Forge viewer uses R71, and they are far past that now with three.js. I have also tried downloading the R71 examples from Github, but I get an error saying that one of the fonts is not existent even when I have included them with script tags in the html. So, are you

Increase thickness of cylinder in three js

拥有回忆 提交于 2020-01-16 08:35:08
问题 I am trying to increase thickness of cylinder using ThreeBSP. Using this http://jsfiddle.net/gerdonabbink/tephoLr1/133/ fiddle but it gives me an constructor error. Type Error: ThreeBSP is not a constructor currently i am using <script type="module"> to load all JS file using 'import' keyword. so is there need to alter library? because i haven't seen any export statement in library so, or is there any other way is available to increase thickness of cylinder? My Code Sample 'Instead of 'THREE'

Applying a matrix in Three.js does not what I expect

只谈情不闲聊 提交于 2020-01-16 06:56:52
问题 For a project I am working on I am trying to get get a 3D-model of a building visible in a browser. Of all the elements of the building I have vertices, indices and a matrix3d. This information comes from an application that uses OpenGL to show the elements in a offline program. Now I am trying to add these elements to my Three.js scene. I am at the point that I can add elements to the scene defined by the vertices and indices an I can see them by using materials and lights, but I can not

Adding number of cubes in three.js

混江龙づ霸主 提交于 2020-01-16 06:11:42
问题 I am trying to add a number of spheres in the following example. Initially it had only three cubes, but I need to add some 10 spheres that would be equidistant from each other and would be rotating in different speeds. My Try var parent, renderer, scene, camera, controls; init(); animate(); function init() { // renderer renderer = new THREE.WebGLRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElement); // scene scene = new THREE.Scene

Is it possible to play skin animation in reverse? [Three.js]

依然范特西╮ 提交于 2020-01-16 03:28:11
问题 How would I go about playing an animation backwards? I've tried giving the animation handler negative delta but that just stops it. Subtracting the delta from this.currentTime of the animation doesn't work either. Any ideas? 回答1: Since Three.js r69 it's possible to play animations in reverse order by setting animation.timeScale = -1 though only when animation.loop = true . See Reverse animation, feature request #5062 for more updates. 来源: https://stackoverflow.com/questions/24282035/is-it

Is it possible to play skin animation in reverse? [Three.js]

岁酱吖の 提交于 2020-01-16 03:28:06
问题 How would I go about playing an animation backwards? I've tried giving the animation handler negative delta but that just stops it. Subtracting the delta from this.currentTime of the animation doesn't work either. Any ideas? 回答1: Since Three.js r69 it's possible to play animations in reverse order by setting animation.timeScale = -1 though only when animation.loop = true . See Reverse animation, feature request #5062 for more updates. 来源: https://stackoverflow.com/questions/24282035/is-it

Twisted normals with the Three.js normal shader - r.58

∥☆過路亽.° 提交于 2020-01-16 01:11:14
问题 I'm attempting to use the Three.js r.58 normal shader to make a displacement map. I have it displacing correctly, but the lighting doesn't seem to be respecting the post-displacement normals, even when I use computeTangents(). When I turn off the displacement, I see that the default normals are definitely funny. Here's a top view of a sphere, lit from the side (the white dot marks a pointLight): And here's a demo page: http://meetar.github.io/three.js-normal-map-0/index0.html What's causing

How to do this coordinate system operation more efficiently?

╄→гoц情女王★ 提交于 2020-01-15 16:00:50
问题 I'm making a 3D game, where the player's back should always be facing the camera and he should move in that direction. I didn't come to the "back facing the camera" part yet, but I believe that it will be simple once I figure out how to move the player in the right direction... Though it is a 3D coordinate system, height can be ignored (z-axis) because no matter how high the camera is, the player should always be going in the same speed (the camera system is planned to function much like in

How to do this coordinate system operation more efficiently?

泄露秘密 提交于 2020-01-15 16:00:22
问题 I'm making a 3D game, where the player's back should always be facing the camera and he should move in that direction. I didn't come to the "back facing the camera" part yet, but I believe that it will be simple once I figure out how to move the player in the right direction... Though it is a 3D coordinate system, height can be ignored (z-axis) because no matter how high the camera is, the player should always be going in the same speed (the camera system is planned to function much like in