Three.js is a JavaScript 3D Library which makes use of WebGL

learn more… | top users | synonyms (1)

-1
votes
0answers
11 views

Bablylon.js and WebSockets [on hold]

Does anyone have any pointers to work done using babylon.js as a way of veiwing real-world data? We have a variety of real sensors are sending motion, location, and visual clues via WebSockets. We ...
0
votes
0answers
23 views

Urban Scene Modling, Serious Game platform [on hold]

I have not built Multi-Player games for a number of years, But I used to be good at building collaborative 3D gaming. But the technology has changed. Now I have a project, and I really like what I see ...
0
votes
1answer
14 views

three.js objects disappear

I haven't got a lot of experience with 3D Frameworks - but was playing around with three.js and came across something that (to me) is a bit odd and I wondered why this happened. I am rendering the ...
0
votes
0answers
35 views

Loading Collada Files Quickly (three.js, OpenGL, Javascript)

Okay, so I've created these sleek-looking spaceship models for an OpenGL game that I'm going to make. To make them look sleek and smooth, I used a Subdivision Surface modifier in Blender. Hmm... ...
1
vote
0answers
12 views

My Directional light lights the floor of my cave but not the ceiling (concave mesh)

I am developing a small demo with Meshes created from a vertex map. When i put a hole in the mesh (making it concave) the physics work fine but the directional lightning only lights one part of the ...
0
votes
1answer
21 views

THREE.JS: why is the rotation only applied on the last axis used?

my function: function rotateAroundWorldAxis2(object, radians1, radians2) { object.rotWorldMatrix.makeRotationX(radians1).makeRotationZ(radians2); // object.rotWorldMatrix; ...
0
votes
1answer
15 views

PhysiJS and objects on top of moving objects

Using Physijs which uses ammo.js. I am attempting to simply place a sphere on top of a box, the box is moving back and forth and I want the sphere to move with it while also being able to move on top ...
0
votes
0answers
27 views

Camera flying freely in space with correct controls?

I want my camera to fly freely in all directions through space. If I use local rotations, then I get unwanted roll (Z axis). If I use global rotation, with the order = "YXZ" fix, then rotation is ...
-3
votes
1answer
80 views

handling wars in multiplayer browser game [closed]

I'm building a browser game about countries, cities, the user control his city, building it upgrading it, can fight other cities in the same country, elections and war between countries, peace, trade ...
0
votes
1answer
42 views

Vertex ordering with THREEjs's exporter

I'm using THREEjs's exporter to export a 2D polygon plane. The resulting JSON gives me the vertices. I'm trying to properly order these vertices as to make the actual polygon shape, without luck. ...
0
votes
0answers
124 views

Implementing wall-sliding physics in THREE.js

Yo, Basically I want to make a 3D environment where the player can walk around a 3D world, and collides with objects / terrain like any other 3rd person / 1st person game. The world can contain any ...
3
votes
1answer
239 views

determining view boundaries based on z position when using a perspective projection

I'm using three.js to make an animation of a box moving around the screen in 3 dimensions. It is moving pseudo-randomly, according to a noise function. So, I want to place an invisible wall just ...
0
votes
1answer
112 views

How can you merge the geometries of cloned objects in Three.JS?

So I'm testing the best non-voxel way to display a lot of objects at once and so I found how to merge geometries. Now, I can easily merge most geometries, but I can't seem to merge the geometries of ...
0
votes
1answer
183 views

WebGL (three.js) - rendering object behind camera far plane

I need to have one object that is always visible/rendered (a lens flare, to be exact). I don't want to set the camera far plane to the maximum possible distance between camera and the sun (performance ...
0
votes
1answer
83 views

JavaScript THREE.js webgl spotlight rendering

I'm playing with webgl/JavaScript/THREE and a spotlight. And I see unexpected results. And I don't understand what's going on, and I'm hoping you can point me in the right direction. In my particular ...
0
votes
2answers
360 views

Three.js: Lighting not calculating correctly on THREE.Geometry objects

I have a three.js (REVISION: '68') issue with the lighting of THREE.Geometry objects: I'm using the THREE.Geometry class to build up objects using vertices and faces, then I computeFaceNormals() ...
0
votes
1answer
125 views

Rendering mountains around a tile layer [closed]

When making a 2D Pokémon game, I just faked elevation by putting mountain tiles underneath the land. Now my tiles are 3D models, so I'm using layer properties to define their elevation. What I don't ...
0
votes
0answers
187 views

WebGL - Luminance textures from JPG images

Is there any way to create a WebGL texture with Luminance format from JPG image? JPG images have 3 color channels and luminance texture has only one channel. The problem is that gl.texImage2D can't ...
1
vote
0answers
181 views

Must light helper be added directly in scene?

Following method of adding light helper works ok: var light = new THREE.SpotLight( 0xFFFFFF ); light.position.set(100,100,100); scene.add(light); var helper = new THREE.SpotLightHelper( light ); ...
0
votes
0answers
74 views

How to evenly add textures to objects in Three.js?

I'm trying to add simple textures to my game in Three.js but I can't figure out how to evenly map textures to differently sized objects. This is how my textures look at the moment: The textures ...
0
votes
1answer
212 views

How to implement 2d collision detection that is immune to low framerate and fast movement? [duplicate]

I am trying to implement my own collision detection for a 2.5d voxel style platformer using Three.js. I have a problem with my implementation - if the framerate is too low or the character is moving ...
4
votes
1answer
1k views

(Three.js) - What object3D properties are required to make rayCaster.intersectObjects() work?

FYI, i am trying to do something almost identical to the following: Merging geometry/mesh without losing benefits I essentially have a list of Three.object3D's. These objects are "merged" together ...
4
votes
1answer
213 views

How do I make cars on a one-dimensional track avoid collisions?

Using three.js, I use a simple spline to represent a road. Cars can only move forward on the spline. A car should be able to slow-down behind a slow moving car. I know how to calculate the distance ...
9
votes
3answers
3k views

Merging geometry/mesh without losing benefits

In three.js we can simply merge geometry to limit the amount of draw calls and thus increase performance. In a simple test with one material, I could draw 50.000 cubes + shadows @ 60fps on my GTX660 ...
2
votes
1answer
578 views

Emscripten code and three.js

I would like, if it's possible, to use Emscripten code generated from C/C++ with the Javascript library three.js. For example, from emscripten code I want to pass rendering information to the three.js ...
3
votes
1answer
2k views

Orthographic Camera and Raycasting in Three.js

I'm working on a test project porting a simple game from iOS to Javascript. I've got the orthographic camera working and it can view the objects in the scene and move up and down the tower of meshes ...
2
votes
1answer
535 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, ...
1
vote
1answer
196 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 ...
4
votes
1answer
383 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
179 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
1k 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
541 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
1answer
107 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
3k 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
351 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
395 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
183 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
113 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 ...
2
votes
1answer
3k 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" ...
2
votes
1answer
898 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
354 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
434 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
1answer
724 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
463 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 ...
5
votes
1answer
375 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: if (game.isKeyDown(37)) { // ...
1
vote
1answer
1k 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
173 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
151 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
604 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 ...
2
votes
1answer
376 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 ...