three.js

Three.js shadow map stripes in each light (now simplified, and with jsfiddle!)

冷暖自知 提交于 2019-12-11 19:13:35
问题 I'm trying to create, modify and update (directional only for now) lights and shadowmaps dynamically. The light, shadow and shadow camera helper gets updated correctly as I move the light around or change shadow properties, except from the light's point of view, everything behind the origin (0,0,0) is shadowed for no apparent reason. Screenshots: http://i.imgur.com/n4AHvle.png http://i.imgur.com/l0uaZHD.jpg http://i.imgur.com/brKwCof.jpg http://i.imgur.com/a6dqMGo.jpg (new, with spotlight)

3d Force Directed Graph - Replacing Nodes with Images

浪尽此生 提交于 2019-12-11 19:06:04
问题 I am trying to figure out the best way to use images to represent nodes, instead of circles. I am using this as a starting point: See code below: <head> <meta content="text/html;charset=utf-8" http-equiv="Content-Type"> <meta content="utf-8" http-equiv="encoding"> <script src="http://d3js.org/d3.v5.min.js" charset="utf-8"></script> <script src="https://unpkg.com/d3-dsv"></script> <script src="https://unpkg.com/d3-fetch"></script> <script src="https://unpkg.com/3d-force-graph@1"></script>

I get “TypeError: a is undefined” when I try to load specific VTK file

痴心易碎 提交于 2019-12-11 18:55:24
问题 I try to load VTK file using three.js, I have changed only one line in example file: loader.load( "models/vtk/srtm.vtk" ); Here is my VTK file. There is TIN vector map, prepared in GRASS GIS, and converted using v.out.vtk command. I am very new in Three.js and 3D Graphics, I just want to check some possibilities of Three.js for further work. 来源: https://stackoverflow.com/questions/19941888/i-get-typeerror-a-is-undefined-when-i-try-to-load-specific-vtk-file

Flame is not showing in THREE.js World

Deadly 提交于 2019-12-11 18:52:35
问题 I am making a flame using the THREE.js and spark.js, but when I render the world I can't see the flame and the world is empty. I saw the console for the error but there is no error regarding this. I tried a lot but can't find out the actual error. Here is the code. threexSparks = new THREEx.Sparks({ maxParticles : 400, counter : new SPARKS.SteadyCounter(300) }); //threexSparks.position.x = 1000; // setup the emitter //var emitter = threexSparks.emitter(); var counter = new SPARKS

three.js shadermaterial not working at all

倖福魔咒の 提交于 2019-12-11 18:38:59
问题 I've been fiddling around with three.js a bit, and im stumped when it comes to THREE.ShaderMaterial . it started out with copy/pasting directly from the example, shown here: http://threejs.org/examples/#webgl_materials_normalmap i copied it into a function that just returns the material. it wouldnt work (error, i'll get to the specifics later), so i removed all the uniforms that had been set and went for a complete blank material. just to see if the same error would still show. so here's my

Threejs: Store jsonModel into a class variable

风流意气都作罢 提交于 2019-12-11 18:27:29
问题 i want to store a loaded json model in Three.js using classes, i can add it to the scene but i can't use it after. My code looks like this one: class AScene extens THREE.Scene{ constructor(renderer){ super(); this.ground = null; this.model = this.createModel() // it creates and return a model, which be the one encapsulating all models in this scene. this.soldier = this.createSoldier(); // I want to store the loaded object here. this.model.add(this.soldier); //doesn't work, always null or

Need web-based AR solutions for Plane detection

大城市里の小女人 提交于 2019-12-11 18:01:32
问题 I am searching for solutions for web-based solutions for AR using marker-less detection i.e using plane detection or object detection. Tried using a-frame framework and three.js but they are only marker-based detection technique to render 3d object. 回答1: I’ve been searching for the same and found 8th Wall https://8thwall.com It works well, and have a few different pricing tiers including a free one. 来源: https://stackoverflow.com/questions/54306700/need-web-based-ar-solutions-for-plane

THREE JS tainted canvas and CORS

孤者浪人 提交于 2019-12-11 17:56:49
问题 I'm trying to render a THREE.js scene having a background image obtained from a different domain. I was getting a tainted canvas error because the image did not have CORS approval and as a result manipulation of the canvas results in a security error. After reading this answer, I set the THREE.TextureLoader() to allow cross origin loading: var loader = new THREE.TextureLoader(); //allow cross origin loading loader.crossOrigin = ''; var texture = loader.load( url_to_image, // Function when

how to change the color of every point

假如想象 提交于 2019-12-11 17:48:41
问题 I try to draw the image with the point ,and the geometry is work well,but I failed to pass the image pixi color to every point function createParticles(imgData) { var uniforms ={ vertexColor:{value: []}} const geometry = new THREE.BufferGeometry(); var c = 0, x = 0, y = 0, positions = [], colors = []; var data = imgData.data; var colors = new Float32Array(imgData.width*imgData.height*3); x = -imgData.width * 0.5; y = imgData.height * 0.5; for (var i = 0; i < imgData.height; i++) { for (var j

How to draw Shape geometry with 3d points(x,y,z) using threejs which is not flat shape(surface)

感情迁移 提交于 2019-12-11 17:24:37
问题 var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 1, 1000); camera.position.set(0, 10, 300); var renderer = new THREE.WebGLRenderer({ antialias: true }); renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElement); var controls = new THREE.TrackballControls(camera, renderer.domElement); var light = new THREE.DirectionalLight(0xffffff, 0.5); light.position.setScalar(100); scene.add