All Questions

44
votes
1answers
9026 views

Rendering meshes with multiple indices

I have some vertex data. Positions, normals, texture coordinates. I probably loaded it from a .obj file or some other format. But each piece of vertex data has its own index. Can I render this mesh da...
117
votes
8answers
36087 views

Learning WebGL and three.js

I'm new and starting to learn about 3D computer graphics in web browsers. I'm interested in making 3D games in a browser. For anyone who has learned both WebGL and three.js... Is knowledge of WebGL ...
9
votes
3answers
15240 views

Drawing a line with three.js dynamically

This is what I'd like to achieve (a modifiable polygon where the red circles are vertices) and I'd like to build the polygon dynamically. When initiating the geometry as var geometry = new THREE.G...
14
votes
4answers
20333 views

How to get object in WebGL 3d space from a mouse click coordinate

I'm building a boardgame in WebGL. The board can be rotated/zoomed. I need a way to translate a click on the canvas element (x,y) into the relevant point in 3D space (x, y, z). The ultimate result is ...
12
votes
1answers
5570 views

Canvas toDataURL() returns blank image only in Firefox

I'm using glfx.js to edit my image but when I'm trying to get that image's data using the toDataURL() function I get a blank image (width the same size as the original image). The strange thing is th...
13
votes
2answers
5739 views

How do you pack one 32bit int Into 4, 8bit ints in glsl / webgl?

I'm looking to parallelize some complex math, and webgl looks like the perfect way to do it. The problem is, you can only read 8 bit integers from textures. I would ideally like to get 32 bit numbers ...
7
votes
1answers
2837 views

Replicating MeshLambertMaterial Using ShaderMaterial ignores textures

I noticed that THREE.js uses shaders internally to create core material "e.g. MeshLambertMaterial", So I decided to copy the lambert shader from Three.js code into a new shader and build on it. This ...
21
votes
6answers
20008 views

Thickness of lines using THREE.LineBasicMaterial

I am using the code below to create hundreds of lines in my three.js scene edgeGeometry[i] = new THREE.Geometry(); edgeGeometry[i].vertices[0] = v(x1,y1,z1); edgeGeometry[i].vertices[1] = v(x2,y2,z2)...
22
votes
1answers
12146 views

Multiple transparent textures on the same mesh face in Three.js

Is it possible to lay multiple textures on top of each other on the same face in Three.js so that the alpha blending is done GPU accelerated in webGL? The textures are (or should be) applied to the s...
9
votes
2answers
10915 views

How to get the absolute position of a vertex in three.js?

As far as I know var point = object.geometry.vertices[i]; will return with the relative position for the x, y and z of the point inside the geometry of the object. How to get the absolute position, ...

Previous Next