Skip to main content

Questions tagged [three.js]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
921 views

I have a question, I need a formula to calculate the distance and a force based on the speed that drags the finger up on the phone. And is there any way I can get a look? And also shows the trajectory ...
Lucas's user avatar
  • 31
1 vote
0 answers
487 views

I'm working on generating programmatic textures for 3d models and showing them in WebGL using Threejs. To do this I generate a texture image (PNG) that contains per-triangle textures (a rectangle on ...
Adrian Muresan's user avatar
2 votes
1 answer
1k views

I'm trying to understand if it's possible to create a game where the player can switch between 2d (strategic/bird view) and 3d (actual gameplay) using only the 3d supported JS/HTML5 game engine, like ...
Kata's user avatar
  • 123
0 votes
1 answer
342 views

I am loading the object from my json file. ...
aryeh's user avatar
  • 101
0 votes
1 answer
1k views

I'm using Three.js to make a web-based 3D first-person game. I would like the player to be able to control the camera rotation with their device's accelerometer. The sensor data is received via the <...
user avatar
2 votes
1 answer
935 views

I'm having trouble getting sprites to display on top of a 3D mesh. My requirements are as follows: Sprite should billboard Sprite should not clip into the mesh Sprite should be hidden when on the ...
Cobertos's user avatar
  • 1,644
2 votes
3 answers
1k views

I'm making a 3D game where the player can walk across the surface of a planet. I am having a problem correctly rotating the camera's frame of reference, so that the camera is oriented correctly ...
peterjwest's user avatar
2 votes
2 answers
10k views

I've been doing some reading and can't seem to figure out a good way to do this.. I have a simple globe with a material on it like so: ...
shan's user avatar
  • 191
4 votes
4 answers
10k views

Okay, I think the problem that I'm having is that when I create my DirectionalLight with three.js, when I then rotate my object with ...
shan's user avatar
  • 191
0 votes
1 answer
886 views

So I'm new to working with a 3D space and not sure how to fix my problem, I basically have a turret that rotates along its Z axis, and pitches along it's Y but after rotating 180 on the Z axis the ...
Julian's user avatar
  • 3
0 votes
1 answer
993 views

I am trying to find a way to render certain objects in my 3d scene without the effects of the perspective projection. E.g. I want them to have the same pixel dimension independent of distance to the ...
thalador's user avatar
  • 366
1 vote
0 answers
667 views

I'm new in 3D rendering with WebGL. I would like to simulate a 3D projectile path using Three.js and Physijs. How could I achieve this?
Gamelover's user avatar
2 votes
1 answer
9k views

I'm new to THREE.js and I have a frustrating problem. I can't get my grass texture to size "normally" on the terrain. I get it, the terrain is steep, but that doesn't mean the grass should be ...
clickbait's user avatar
  • 257
0 votes
4 answers
2k views

I'm just starting with threejs, and I'm building a basic first person shooter. I use pointer lock controls. When the user clicks ("shoots") an object, I remove it and place it at another random ...
binoculars's user avatar
2 votes
1 answer
91 views

I've played Metroid Blast on Wii U, and would like to build one of its features in a three.js game. The feature is: if an opponent is out of view, a guide is displayed showing the direction of the ...
Emil's user avatar
  • 21
0 votes
1 answer
2k views

I am in the process of implementing interpolation into a simple game loop I am playing with after reading the infamous "fix your timestep" article (which is amazing by the way). I have the position ...
whitwhoa's user avatar
  • 201
1 vote
1 answer
309 views

First off let me apologize for the vague title but I really couldn't think of a more descriptive one (maybe after reading this a more advanced user might be able to edit it). Alright, so I have been ...
whitwhoa's user avatar
  • 201
1 vote
0 answers
82 views

I am using the following function to have a globe rotate a point on its surface to face the global Z toward the camera. This works fine, but after each rotation the Y axis seen as a green line is not ...
Neil's user avatar
  • 153
4 votes
2 answers
3k views

I'm trying to create a browser moba-like game using three.js. I'm using WASD for movement and the player rotation follows the mouse with mousemove then lookAt() the ...
Eptick's user avatar
  • 41
3 votes
0 answers
747 views

I am trying to move a ball mesh through a maze. The maze belongs to a parent object3d. My issue is that when I move the ball I can't detect collision right well because in the rotation, the axis ...
myhappycoding's user avatar
4 votes
1 answer
159 views

I'm using the Three.js JavaScript library to do some things in WebGL, and I wonder how the graphic aspects of timers are done on mobile. I was creating numbers with geometries and just replacing them ...
Kahless's user avatar
  • 141
1 vote
0 answers
58 views

I'm new on Three.js and despite a mechanical background, I can't find how quaternion works: it's like it always refers on local part referential and not the global one. I've illustrated it here : ...
NicoC's user avatar
  • 111
1 vote
0 answers
67 views

I created a video that describes the problem since it very hard to explain it. Basically, using physi.js, I am applying random impulse on the object. In the video, at 0:17 the problem begins when the ...
eddyuk's user avatar
  • 123
2 votes
1 answer
470 views

I have a hexagon tiled geometry I created in Blender Which I then load in WebGL, using THREE.js library. Below is the loading code, I've cut the code of creating scene, lights, etc. I create rendered ...
user1617735's user avatar
0 votes
1 answer
3k views

I want to buy some assets from the Unity asset store and use them in my three.js project, but I am not sure what the best way to go about this is. Some cursory googling got me this, but Collada ...
Josh's user avatar
  • 141
0 votes
1 answer
3k views

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 ...
Dylan Meeus's user avatar
1 vote
3 answers
1k views

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... ...
Superdoggy's user avatar
1 vote
0 answers
46 views

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 ...
Gadgetsan's user avatar
0 votes
1 answer
2k views

my function: ...
juansnow's user avatar
0 votes
1 answer
830 views

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 ...
Evilzebra's user avatar
  • 111
-3 votes
1 answer
333 views

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 ...
Art3mix's user avatar
  • 107
4 votes
1 answer
939 views

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. ...
John's user avatar
  • 186
3 votes
1 answer
4k views

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 ...
Luke's user avatar
  • 187
0 votes
1 answer
2k views

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 ...
Garrett's user avatar
  • 101
1 vote
1 answer
1k views

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 ...
tomi.lee.jones's user avatar
0 votes
1 answer
220 views

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 ...
user2693072's user avatar
1 vote
2 answers
4k views

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() and ...
DavidWaugh's user avatar
0 votes
1 answer
353 views

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 ...
Shien's user avatar
  • 257
1 vote
0 answers
1k views

Following method of adding light helper works ok: ...
lot's user avatar
  • 223
1 vote
1 answer
2k views

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 ...
Tilen Pogačnik's user avatar
5 votes
2 answers
8k views

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" ...
AlvinfromDiaspar's user avatar
4 votes
1 answer
668 views

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 ...
user990827's user avatar
11 votes
4 answers
10k views

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 ...
user990827's user avatar
2 votes
1 answer
2k views

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 ...
samleo's user avatar
  • 31
4 votes
1 answer
7k views

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 ...
bazola's user avatar
  • 218
2 votes
1 answer
3k views

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: ...
Gerharddc's user avatar
  • 392
1 vote
1 answer
822 views

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 ...
user46400's user avatar
4 votes
1 answer
5k views

Here's one way to implement delta time: ...
Starkers's user avatar
  • 961
-2 votes
1 answer
1k views

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: ...
Ramy Al Zuhouri's user avatar
0 votes
2 answers
6k views

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
expiredninja's user avatar