three.js

Blender 2.7X Exporter to .json For three.js JSONLoader

僤鯓⒐⒋嵵緔 提交于 2019-12-24 03:16:02
问题 I am trying to export from Blender into Three.js using the JSON route (for animations) Three.js version r71 Blender version 2.74 The current Blender exporter successfully exports a .json file NOT a .js file. All examples within the r71 folders import .js files only. Does anyone have any working examples on how to import a .json file that has been exported from Blender 2.7x? If not, I'll have to go back to Blender 2.69 and use the commonly documented .js import. 回答1: I might be wrong but .json

Export ThreeJS Geometry to JSON

我怕爱的太早我们不能终老 提交于 2019-12-24 03:07:54
问题 I need to export Three Geometry to JSON so I can used with xml3D. I am trying to find the THREE.GeometryExporter() but I can't. Has it been completely deprecated? It is mentioned here Once I have the Three JSON I should be able to use this converter to obtain the xml3D JSON. Has anyone tried this before? 回答1: You should try the toJSON() method : var json = geometry.toJSON(); This method is available for geometries, materials, lights, mesh ... 回答2: Realease 68 seems to be the last one with

Three.js - can I detect geometry 'islands' when importing?

落爺英雄遲暮 提交于 2019-12-24 02:45:09
问题 I'm importing .3DS models into Blender 2.72b, then exporting them with the Three.js import/export addon. The models have multiple geometry 'islands' (separate groups of connected faces and vertices), each with its own material. I'd like to be able to pair each material with its corresponding island, without having to create separate THREE.Geometry objects. After some digging, I found this question which suggests using a THREE.MeshFaceMaterial to achieve multiple materials for one object. The

Direction of rotation or handedness in three.js

依然范特西╮ 提交于 2019-12-24 02:07:07
问题 I've noticed that when I rotate my model around the Z axis, like this: model.rotateZ(rotatedAngle * Math.PI / 180); it seems to rotate counter-clockwise around the axis. Is this observation accurate? Is this documented somewhere? I couldn't find it, perhaps I'm using the wrong search terms. Is this configurable? Most importantly what is the best practice for managing rotations? 回答1: Three.js uses the right handed system and this means counter clockwise is default rotation. See here for all

Trying to color a cube in Three.js

假装没事ソ 提交于 2019-12-24 01:47:28
问题 I am trying to color a cube in three.js with 3 different colors but it seems like I am hitting some cap on the amount of THREE.DirectionalLight objects I can add to a scene. In the documentation I do not see any mention of a limit like this, so I am wondering if this is really the case or if I am missing something else? http://jsfiddle.net/ZMwfc/ var renderer = new THREE.WebGLRenderer(); renderer.setSize( 800, 600 ); document.body.appendChild( renderer.domElement ); var scene = new THREE

Three.js merging meshes but keeping separate materials

倾然丶 夕夏残阳落幕 提交于 2019-12-24 01:44:34
问题 I am working on a visualization project based through a web server and I have it working and looking how I want it but it is much slower than I was hoping. Basically, it has a huge grid for modeling a space and then individual cubes are displayed in the grid with different colors (or just removed currently if there is nothing there, but could easily just use transparent materials instead) to represent how likely there is an object in that area of the grid, and the colors need to change

MeshNormalMaterial not working on a three.js custom geometry: the geometry renders as black

╄→尐↘猪︶ㄣ 提交于 2019-12-24 01:39:46
问题 I am trying to construct a cube manually using three.js by declaring its vectors and faces; I am able to do it using the code below, however, the material does not seem to be working as expected, instead the cube is rendering in a solid black color. var geom = new THREE.Geometry(); var v1 = new THREE.Vector3( -1, 1, 0.1 ), v2 = new THREE.Vector3( 1, 1, 0.1 ), v3 = new THREE.Vector3( 1, -1, 0.1 ), v4 = new THREE.Vector3( -1, -1, 0.1 ), v5 = new THREE.Vector3( -1, 1, 2 ), v6 = new THREE.Vector3

How to apply a texture to THREE.ExtrudeGeometry?

大城市里の小女人 提交于 2019-12-24 01:33:29
问题 var arcShape = new THREE.Shape(); arcShape.moveTo( 50, 10 ); arcShape.absarc( 10, 10, 40, 0, Math.PI*2, false ); var map1 = new THREE.ImageUtils.loadTexture( 'moon.jpg' ); var geometry = new THREE.ExtrudeGeometry( arcShape, extrudeSettings ); var new3D = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { map: map1 } ) ); new3D.receiveShadow = true; obj3Dmassive.add( new3D ); Texture (512x512): http://f3.s.qip.ru/cMfvUhNj.png Result: http://f3.s.qip.ru/cMfvUhNh.png How to fill a texture

WebGL / Three.js Different materials on one complex object (grid)

☆樱花仙子☆ 提交于 2019-12-24 01:25:30
问题 In order to increase performance i render grid to one THREE.Geometry() object in such loop: build : function(){ // simplified square = new THREE.Geometry(); face = 0; for( r = 0; r < this["rows"]; r++) for( c = 0; c < this["cols"]; c++) // creates square square.vertices.push(new THREE.Vector3( x, y, z)); square.vertices.push(new THREE.Vector3( x + w, y, z)); square.vertices.push(new THREE.Vector3( x + w, y - h, z)); square.vertices.push(new THREE.Vector3( x, y - h, z)); square.faces.push(new

Refreshing dat.gui variable

怎甘沉沦 提交于 2019-12-24 01:10:48
问题 This is a dropdown list within a dat.gui interface. Once you click any number, the jumpSwitcher will be whatever number you chose. I’m trying to replace each list that pertains to their specific number based on that what the user chose for Starsystem . So solPlanets= ['Ilos', 'Tuchanka', 'Illium', 'Palaven'] is what shows in list 2 when you click on 2. On default, solPlanets shows ['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus', 'Neptune'] because default is jumpSwitcher =