Three.js is a JavaScript 3D Library which makes use of WebGL
1
vote
0answers
31 views
Three.js camera turning leftside right
In Three.js I am trying to implement an orbiting camera can be rotated around the x and the y axis. I am using these two functions:
function rotateX(rot) {
var x = camera.position.x,
...
0
votes
0answers
65 views
Collision Detection and Resolution in Three.js
So at the moment am making a simple game using three.js and three.firstpersonControls.js but with the current Three.js r66, they apparently removed checkWallCollision and then in the r67 ...
0
votes
1answer
61 views
How to make player rotate towards mouse [duplicate]
I'm making a top down shooter with Three.js and Box2d. I'm displaying all of the graphics in 3d, but all of the physics are done in 2d, so it's sort of like super smash bros in a way.
Anyway, how can ...
3
votes
1answer
139 views
Most efficient way to implement delta time
Here's one way to implement delta time:
/// init ///
var duration = 5000,
currentTime = Date.now();
// and create cube, scene, camera ect
//////
function animate() {
/// determine delta ///
...
-2
votes
1answer
52 views
List of GLSL ES built-in variables
I am writing an article on WebGL and three.js, I'm trying to search all the built-in variables available in the vertex and fragment shader.
I've found many sites mentioning some, for example:
...
0
votes
2answers
64 views
what function creates rotation effect in three.js?
which part of the code is responsible for the rotation in this example? Is it the camera or the scene itself?
http://threejs.org/examples/#canvas_camera_orthographic
0
votes
1answer
213 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 ...
0
votes
0answers
42 views
Is it possible or not to share a geometry among many meshes and applied a different shaderMaterial for each?
I instanciate one PlaneGeometry, then I instanciate 200 meshes sharing this geometry and with their own instance of a given shaderMaterial. Here is a simplified version of the code :
...
var geom = ...
1
vote
2answers
1k 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 ...
1
vote
1answer
101 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
1answer
171 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
0answers
77 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
1answer
59 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 ...
1
vote
1answer
332 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.
<script id="vertexShader" ...
0
votes
1answer
281 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
1answer
194 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 field, all works great.
See it in ...
1
vote
1answer
259 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 ...
1
vote
1answer
372 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 applyCentralImpulse ...
1
vote
1answer
263 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 ...
0
votes
1answer
694 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
1answer
148 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
0answers
101 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 ShapeGeometry has something to do with this, ...
4
votes
1answer
466 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:
rotated = vector.applyQuaternion(
new ...
1
vote
1answer
3k 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.
...