three.js

tweening particles in buffergeometry

廉价感情. 提交于 2019-12-13 18:40:00
问题 This question piggybacks on the following questions: Three.js - Buffer geometry particles, need to animate random groups of particles in system How to quickly update a large BufferGeometry? I'm starting a new project that will have tens of thousands of particles in the scene at any time. The concept is that there will be clusters of particles that look like galaxies spread throughout the scene. Sometimes I will need animate a galaxy and its thousands of particles. Can I do this while the

Three.js Particles of various sizes

别等时光非礼了梦想. 提交于 2019-12-13 18:19:05
问题 I'm new to three.js and am trying to figure out the best way to add a 1000 particles each being a different size and color. The texture for each particle is created by drawing a canvas. By using a ParticleSystem all the particles are the same color and size. Creating a ParticleSystem for each particle is very inefficient. Is there an efficient way to handle this? 回答1: The best way to go about this, in my experience, is to create a customized shader material; you can then include attributes,

Using a Typescript .d.ts file that doesn't declare a module

戏子无情 提交于 2019-12-13 18:11:22
问题 I'm using tsd to download definitions from Definitely Typed and compile into a tsd.d.ts file. I haven't been able to build yet, but when I use an import like this: import * as THREE from "three" Visual Studio intellisense is happy. However, this doesn't work for Detector.js (a three.js library for detecting webgl support), with this .d.ts file. I'm not sure what the issue is, but I did notice that the three.d.ts file exports a module (THREE) and detector.d.ts file just exports an object:

Rotating an Object properly around a pivot point given axis and angle

霸气de小男生 提交于 2019-12-13 18:00:36
问题 In Three.js there seems to be quite a few ways of rotation which i personally do not find very intuitive. See e.g. the example http://cloud.engineering-bear.com/apps/robot/robot.html I get very strange unexpected effects when I apply rotation to multiple objects. E.g. when I rotate objects that have been added to each other and start rotating the parent the individual objects will all over sudden by placed differently in respect to each other then they originally where. I am now experimenting

Three.js flipSided property

此生再无相见时 提交于 2019-12-13 17:14:24
问题 I can't seem to find the flipSided property in the documentation for material. I have a mesh that has 2 sides but I would like to flip it's sides. Does anyone know where that property went? Edit: To clarify I meant to flip the sides of a two sided object. 回答1: See the Migration Guide for help upgrading to the current version. There you will find the following: doubleSided / flipSided properties moved from Object3D to Material 's side property ( THREE.FrontSide , THREE.BackSide and THREE

Texture from hard disk not loading in three.js - showing black

霸气de小男生 提交于 2019-12-13 17:10:33
问题 I encountered problem on trying to load images from the local machine. If I give a link in internet to a jpeg file it works okay, but if I replace with path from my local machine - the texture is black. var texture = THREE.ImageUtils.loadTexture( 'http://ewgl.erbix.com/js/nodes2/textures/sun.jpg', {}, function(){ renderer.render(scene, camera); } ); paintMaterial = new THREE.MeshBasicMaterial({map: texture}) So instead of 'http://ewgl.erbix.com/js/nodes2/textures/sun.jpg' if I load the same

How to load 3D object at runtime in aframe?

强颜欢笑 提交于 2019-12-13 17:09:39
问题 I am working on an aframe project where runtime loading of 3D object is required. I have read A-Frame documentations, and aframe doesn't seem to support runtime assets loading at all. I discovered this aframe-asset-on-demand-component by protyze (https://github.com/protyze/aframe-asset-on-demand-component) and it seems to allow runtime loading of img, audio and video. But its documentation does not indicate the possibility of loading 3D objects like files in .obj or .dae at runtime. Has

WebGL textureCube bias causing seams

泪湿孤枕 提交于 2019-12-13 16:32:26
问题 I am experimenting with a dds texture and cubemap mip maps. When changing the bias in textureCube() i get really nasty normal artifacts. I have no idea what is causing this and cant find much reference on the bias parameter. Live: (need to switch to uv and turn off normal) http://dusanbosnjak.com/test/webGL/new/poredjenjeNM/poredjenjeNormalaBias.html Screen: More Screens: Bias 4 edit Also of note, when you orbit around at say bias 6, you can clearly see the cubemap looking more or less

WebGL/OpenGL: Rotate camera according to device orientation

走远了吗. 提交于 2019-12-13 16:23:41
问题 I have a web application I am trying to show a plane of map image tiles in a 3D space. I want the plane to be always horizontal however the device rotate, the final effect is similar to this marine compass demo. I can now capture device orientation through the W3C device orientation API for mobile devices, and I successfully rendered the map image tiles. My problem is me lacking of essential math knowledge of how to rotate the camera correctly according to the device orientation. I am using

After converting my FBX file to a .gltf, the model is incredibly small, why?

折月煮酒 提交于 2019-12-13 16:08:19
问题 QUESTION: After converting my FBX file to a .gltf, the model is incredibly small, why ? I tried scaling the model with frontObject.scale.set( 1000, 1000, 1000 ); but I get the following error: TypeError: Cannot read property 'set' of undefined Furthermore, in function ( xhr ) { progressBar.style.display = "block"; progressBar.style.width = ( xhr.loaded / xhr.total * 100 ) + '%'; loadingText.innerHTML = 'Loading... '+xhr.loaded+"/"+xhr.total; // For some reason, xhr.total = 0, so I can't use