three.js

Add Thickness to faces

你离开我真会死。 提交于 2019-12-24 07:10:09
问题 i create walls by creating faces with some points i have. The creation of the walls does work without an issue. Now i want to add some thickness to my walls but iam not quite sure how to. here is my code for creating my walls: makeWall(start, end) { let v1 = this.helpers.toVec3(start); //0 let v2 = this.helpers.toVec3(end); //1 let v3 = v2.clone(); //2 v3.y = this.wallHeight; let v4 = v1.clone(); //3 v4.y = this.wallHeight; let points = [ v1.clone(), v2.clone(), v3.clone(), v4.clone() ];

How can I create a 3D surface from 3D points in Three.js?

南楼画角 提交于 2019-12-24 07:07:22
问题 I'm making a project to make simple 3d models with dots and lines (curved or not). For a first version I used SVG elements for simple render, smooth curves and mouse events. Now I'm trying to use Three.js renderer instead of SVG. I got to create 3d tubes to replace the curved lines, but I don't know how to create 3d surfaces based on multiple xyz coordinates . Here is an example of a model made of 4 points and 4 lines (3 straights and 1 curved): We could imagine that the curve is extruded to

Transitioning vertices between 3D models with three.js

喜夏-厌秋 提交于 2019-12-24 07:01:13
问题 I am trying to achieve polygon blowing and reassembling effect similar to: http://na.leagueoflegends.com/en/featured/skins/project-2016 https://tkmh.me/ In both of these examples, you can see how they are morphing / transitioning the vertices from one 3d model to another, resulting in a pretty cool effect. I have something similar working, but I can't wrap my head around how they are transitioning the vertices with velocity offsets (please refer to the first link and see how the particles don

Aframe envMap not applying to first primitive

我与影子孤独终老i 提交于 2019-12-24 06:49:32
问题 A cubic envMap seems to skip the first object it's applied to. Subsequent objects referencing the same map are fine. Reordering the objects in the HTML still results in which ever is first being skipped. Reordering in space has no effect. https://github.com/scottmsinger/aframe/tree/master/tests/env_map_order 回答1: Your cubemap tag is missing a close tag. That might be messing with the interpretation of the nextmost tag, causing the issue. <a-assets> <a-cubemap id="sky"> ... </a-cubemap> <--

three.js: How to add materials array to octahedron geometry

风格不统一 提交于 2019-12-24 06:32:47
问题 I would like to add multiple materials to a THREE.OctahedronGeometry . This works fine for box objects, but for THREE.OctahedronGeometry I just get the first material on all faces. How can I get a different material on each face? var geometry = new THREE.OctahedronGeometry(1, 0); var materials = [ new THREE.MeshPhongMaterial( { color: 0x050505, dithering: true } ), new THREE.MeshPhongMaterial( { color: 0xeeeeee, dithering: true } ), new THREE.MeshPhongMaterial( { color: 0x060606, dithering:

three.js: How to add materials array to octahedron geometry

故事扮演 提交于 2019-12-24 06:32:04
问题 I would like to add multiple materials to a THREE.OctahedronGeometry . This works fine for box objects, but for THREE.OctahedronGeometry I just get the first material on all faces. How can I get a different material on each face? var geometry = new THREE.OctahedronGeometry(1, 0); var materials = [ new THREE.MeshPhongMaterial( { color: 0x050505, dithering: true } ), new THREE.MeshPhongMaterial( { color: 0xeeeeee, dithering: true } ), new THREE.MeshPhongMaterial( { color: 0x060606, dithering:

.points opacity / size within three.js

…衆ロ難τιáo~ 提交于 2019-12-24 06:21:56
问题 I'm back for question two on .points. This time wondering how to change the opacity from 0, to 1 and then back within certain pixel distances from the emitter. var particleCount = 14, particles = new THREE.Geometry(), pMaterial = new THREE.PointsMaterial({ map: new THREE.TextureLoader().load("x.png"), blending: THREE.multiplyBlending, flatShading: true, size: 40, transparent: true, depthTest: true, sizeAttenuation: true, opacity: 1 }); var particleSystem; My main confusion is that even though

ThreeJS understanding where lights are

烈酒焚心 提交于 2019-12-24 05:52:06
问题 I've been trying for around 30 minutes to position a pointlight at the bottom of my model with very poor results. I don't know how many units my model is and I can't seem to exactly locate my light in the scene most of the time. I tried adding a cube at the exact position of my pointlight but somehow adding another geometry to my scene breaks the texture update function for my main obj, so I guess that's out of the question. Any tips on how to position lights with precision? My code is at

ThreeJS understanding where lights are

萝らか妹 提交于 2019-12-24 05:50:06
问题 I've been trying for around 30 minutes to position a pointlight at the bottom of my model with very poor results. I don't know how many units my model is and I can't seem to exactly locate my light in the scene most of the time. I tried adding a cube at the exact position of my pointlight but somehow adding another geometry to my scene breaks the texture update function for my main obj, so I guess that's out of the question. Any tips on how to position lights with precision? My code is at

Shader Materials and GL Framebuffers in THREE.js

荒凉一梦 提交于 2019-12-24 05:49:50
问题 I'm trying to use an FBO in a material in THREE.js. I have a GPU-based fluid simulation which outputs its final visualisation to a framebuffer object, which I would like to use to texture a mesh. Here's my simple fragment shader: varying vec2 vUv; uniform sampler2D tDiffuse; void main() { gl_FragColor = texture2D( tDiffuse, vUv ); } I am then trying to use a simple THREE.ShaderMaterial: var material = new THREE.ShaderMaterial( { uniforms: { tDiffuse: { type: "t", value: outputFBO } }, //other