Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [three.js]

Three.js is a lightweight cross-browser JavaScript library/API used to create and display animated 3D computer graphics on a Web browser. Three.js scripts may be used in conjunction with the HTML5 canvas element, SVG or WebGL.

11 votes
5 answers
9k views

How to solve different FPS in requestAnimationFrame on different browsers?

How to solve different FPS in requestAnimationFrame on different browsers? I am making a 3D game using THREE.js that uses requestAnimationFrame and it is fast on Google Chrome 15. However, it is ...
Derek 朕會功夫's user avatar
1 vote
1 answer
2k views

Displaying multiple frames of a video element simultaneously

Some background: graphics newbie here, have just dipped my toes into the world of 3D in the browser with mrdoob's excellent three.js. I intend to go through all the tuts at http://learningwebgl.com/ ...
Robin Pyon's user avatar
13 votes
5 answers
19k views

WebGL - Textured terrain with heightmap

I'm trying to create a 3D terrain using WebGL. I have a jpg with the texture for the terrain, and another jpg with the height values (-1 to 1). I've looked at various wrapper libraries (like SpiderGL ...
goocreations's user avatar
  • 3,036
3 votes
2 answers
5k views

Rotate, then translate in three.js

I would like to rotate then a plane created with THREE.PlaneGeometry, but I have some problems. What's the axis in front of the camera with FirstPersonCamera ? My own tests have revealed a X-front/...
Maël Nison's user avatar
  • 7,273
0 votes
1 answer
872 views

What is the best way of writing box-box ray collision detection in three.js?

The objects in this experiment are moving around randomly: http://deeplogic.info/project/webGL/ What is the best way of writing a box-box ray collision detection for this using the three.js library?
Sycren's user avatar
  • 539
0 votes
1 answer
100 views

For a given Z depth, how do I find the rectangle of the viewable area?

Or, to ask the same thing another way: For a given Z depth in a 3D scene, I want the X and Y coordinates that will allow me to place an object just outside of the viewable area. I'm using three.js ...
EMiller's user avatar
  • 1,138
0 votes
1 answer
772 views

THREE.js: problem loading Particle

If anyone can get this guy's small bit of code working on their machine, I'd be grateful if they could help me out by letting me know how. I've taken the HTML and JS from this page: http://projects....
Alex's user avatar
  • 4,904
4 votes
1 answer
3k views

3D JS Engine for 2D development?

I'm about to jump into some simple game development with Javascript. I would like to one day transition to 3D development but for now am only going to be doing 2D "top down" objects. I know that this ...
James P. Wright's user avatar
0 votes
2 answers
2k views

WebGL - Rotating object in the direction it is travelling

In this example: http://deeplogic.info/project/webGL/ How can I rotate the object in the direction in which it is travelling?
Sycren's user avatar
  • 539
1 vote
1 answer
2k views

Three.js custom textured meshes

Is it possible to add a textured material to an object with a custom mesh in Three.js? Whenever I try exporting an object from Blender to Three.js with a texture on it, the object disappears. Looking ...
Kevin Laity's user avatar
  • 2,509
1 vote
1 answer
981 views

Z-Axis Coordination in WebGL and Three.js

I'm experimenting with WebGL and Three.js, But how to calculate the Z-Axis coordination while moving mouse? I use this for X and Y: function getCoord(e) { X = e.layerX - canvas.offsetLeft; ...
xxx's user avatar
  • 554
3 votes
1 answer
2k views

How does the calculation of the light model work in a shader program?

I am trying to read up this tutorial: https://aerotwist.com/tutorials/an-introduction-to-shaders-part-2/ but I am not able to follow up. Basically the code creates a directional light by using ...
TCM's user avatar
  • 16.9k
9 votes
6 answers
4k views

From where can I get learning resources for three.js

I am just trying my hands at three.js. This is the link: https://github.com/mrdoob/three.js/ But there seems to be no documentation for this and rightly so because it is developed by a small(but ...
TCM's user avatar
  • 16.9k
9 votes
4 answers
10k views

How do I use texture on a sphere in three.js

I've downloaded a sphere example from: http://aerotwist.com/lab/getting-started-with-three-js/ and I can see the nice red sphere. I'd like to use a texture on it. I've tried this: var texture = THREE....
Gavriel's user avatar
  • 19.1k
0 votes
1 answer
328 views

How to create pivot screens in Javascript?

How can I create such an effect in Javascript (Three.js usind canvas elements?) like there described? Pivot Screen: http://www.smashingmagazine.com/2011/07/27/what-web-designers-can-learn-from-video-...
user avatar

15 30 50 per page