Questions tagged [three.js]
Three.js is a JavaScript 3D Library which makes use of WebGL
125 questions
0
votes
1
answer
1k
views
First person camera world matrix issue (in THREE.js and webGL)
I'm trying to create a Portal-like effect in webGL using THREE.js.
I have two scenes connected by a pair of portals. The view of the 2nd scene in rendered inside the 1st portal using stencils and ...
2
votes
1
answer
260
views
Is it possible or not to share a geometry among many meshes and apply a different shaderMaterial for each?
I instantiate one PlaneGeometry, then I instantiate 200 meshes sharing this geometry and with their own instance of a given shaderMaterial. Here is a simplified version of the code :
...
1
vote
2
answers
6k
views
How to load geometry/object/scene created in Clara.io with Three.js
Does anybody know how to load anything created in Clara.io into your Three.js scene?
Clara.io allows export of ThreeJS geometry, object or scene. I tried all those in combination with all THREE ...
4
votes
1
answer
942
views
Starting with shaders and particles
I'm working on a flow field with particle systems and starting to learn about shaders in three.js.
Current state of my work is available here.
As such amount of calculations is quite heavy for a big ...
0
votes
1
answer
925
views
Particle movement in three Dimensions
I have created a particle system which movement is controlled by a flow field over perlin noise - Available here.
I would be very thankful for any ideas and tips how to control their movement on the ...
0
votes
0
answers
516
views
parametric 3D sphere unwrapping math for perfect 3D-textures
After some time looking or it on the internet I can't find the proper answer to my concern.
I'm currently generating 3D textures on a shader for my planets to avoid sphere mapping issues (pole, ...
0
votes
1
answer
343
views
How would one outline an alpha transparency layer in javscript and/or php? [duplicate]
I simply want an outline/edge detection of the character/item/object that is selected or doing something.
I'm seeing lots of versions of this question for different languages, but I would appreciate ...
15
votes
1
answer
39k
views
How to compute tangent and bitangent vectors
I have a texture loaded in three.js, then passed to the shaders. In the vertex shader I compute the normal, and I save into a variable the uv vector.
...
3
votes
1
answer
3k
views
Reduce render time for a tiled map in ThreeJS
I'm working on a WebGL game using Three.js, its been a few days and I found my first issue, render time on big maps.
The game runs great, there are even some AI mobs that run around randomly like ...
1
vote
1
answer
799
views
Replace a div (with a ball picture in it) with a 3D canvas ball [closed]
I am trying to make a game where you have to keep the ball on a green platform. At this point the ball is a div with a ball image. You can move the ball over the ...
1
vote
1
answer
790
views
UV mapping issues while loading collada model exported with Sketchup
I load collada models, exported via Google Sketchup, into my Three.js (v63) scene with the Three.js collada loader.
The models are loaded, but with some, textures aren't well mapped, like in the ...
2
votes
1
answer
3k
views
How can I implement a simple "jump" action with three.js and/or Physijs?
Assume I have a simple Physijs object like this car. How can I adapt something like this to "jump" (hydraulics ftw!) when pressing spacebar for instance?
I'm currently thinking ...
1
vote
1
answer
1k
views
How to manage frustum culling
I have a spherical clipmap based planet terrain. The entire planet is made from a ring geometry of 1 unit which the vertex shader moves to cover the entire planet of 6 million unit radius. But the ...
6
votes
2
answers
2k
views
Walking on a sphere
I'm working on a game which involves walking your character on the surface of a sphere. Using the answer to Arbitrary Rotation about a Sphere, I've written my code as:
...
1
vote
2
answers
4k
views
Three.js camera rotation and behavior
I'm just getting into Three.js and the camera is causing some problems. Basically, I want to implement spectator-like movement controls, so that I can move around freely in the scene. The problem is ...
2
votes
1
answer
294
views
How good do I have to be at Math to create a 3D game using three.js? [closed]
A question I've often had, how good at Math do I need to be to create 3 dimensional games? I get along with 2d games just fine. I understand everything I'm doing without problems after practise. ...
1
vote
0
answers
267
views
Is there an out-of-the-box way to create a custom non-convex polygon in three.js?
Does Three.js offer an out-of-the-box way to create custom non-convex polygon, or do I have to use THREE.Geometry and set faces manually? I'm guessing that ...
4
votes
1
answer
776
views
Why game engines usually don't offer a vector3.rotate method? [closed]
Game engines like Three.js, Ogre3d and Unity3d often don't provide a default rotate method on their vector class. You usually have to do something like:
...
2
votes
1
answer
610
views
Particle systems on multiplayer games
I'm working on a 2D javascript/Three.js multiplayer game, using web sockets and an authoritative server currently written in Python.
The combat mechanic will be similar to Geometry Wars however i'm ...
0
votes
1
answer
905
views
best way of rendering more 3D models in three.js that not slow down page?
I am in the way of creating a 3D web game using threeJS library. This is a multi-player game that players are 3D human models in game, and I need to add a human 3D model for each player that enters ...
2
votes
2
answers
10k
views
How to handle 3D collisions using raycasting (with a reflection vector?)
I'm making a game using THREE.JS, and I want my character to walk on the terrain, and collide with static 3D objects (=AABB boxes) that are on that terrain.
The problem is: THREE.JS has only a ...
3
votes
2
answers
6k
views
Quaternions - how to limit axis?
Is there any possibility to limit quaternions to move only in x & y axis (like in Eulers- yaw and pitch, without rolling)? I's there any equation or something similar to do this?
Some example:
...
4
votes
2
answers
5k
views
How to rotate an object so it stands correctly (back always facing the camera)
I have the following scene:
And I have two 3D vectors, the camera position, and the focus position. The focus vector is always behind the monster. I know how to rotate the camera around the focus with ...
1
vote
2
answers
8k
views
Rotate 3D camera relative to what's on screen (in threejs)
I'm trying to have a camera in Threejs react to respective left/right/up/down/forward/backward keys, always based on the direction the camera is currently facing. It works fine left/right (camera....
3
votes
1
answer
13k
views
Translate object in world space usings it's local rotation
I'm using Three.JS to render some objects. I'm struggling with some very simple object rendering and translation.
The scenario is that I spawn an object at 0,0,0 in world space with 0,0,0 rotation.
<...