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
0 votes
1 answer
54 views

I’m in the process of designing a threejs-based webxr engine for simple VR games. Right now, I’m working on implementing physics with cannon-es, but I’m struggling to figure out how to sync the player’...
0 votes
1 answer
715 views

First, I knew the following basic knowledges, GLSL Language, Learn WebGL2 ​- GLSL ​* GLSL Shaders OpenGL - Coordinate Systems, [OpenGL - Advanced GLSL] 3D Game Shaders For Beginners - GLSL ...
0 votes
1 answer
728 views

I developed a multiplayer FPS using WebGL, Nodejs and WebSockets. So far it is running great. I am currently using setInterval(sendPlayerPositions, 16); to send updates to WebGL clients. Ideally I ...
0 votes
0 answers
88 views

I am trying to make a game slimier to Minecraft, where there is a world of blocks, and a player that can walk, jump, and place blocks. Lately, I've been struggling to get collision detection between ...
13 votes
1 answer
4k views

I am developing an RTS game with boats, the boats can shoot very frequently and I am having a hard time dealing with the explosion sounds. I am using three.js and the audio API it has that uses the ...
0 votes
0 answers
46 views

I posted this on stackoverflow, then thought it might be better here where the gamedev experts are: I am experimenting with threejs and react three fibre. I have a box which I am sending around a ...
1 vote
1 answer
665 views

When I rotate the camera some of my blender models become transparent from different angles. They are gltf models Here is the Python to save the gltfs ...
0 votes
3 answers
655 views

I've got a PerspectiveCamera and set of coordinates (x,y,z). How could I pan the camera to make these coordinates at the center of the screen?
3 votes
1 answer
801 views

I'm currently working on a Three.js project, and I'm aiming to create a seamless cube map. To achieve this, I created six planes and assembled them into a cube. Then, I utilized a shader to generate ...
0 votes
1 answer
129 views

In my project, I have created a normalized cube using six plane meshes. To improve its visual quality, I added a displacement texture and calculated the normals for that texture to ensure proper ...
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: ...
15 votes
1 answer
39k views

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. ...
1 vote
2 answers
390 views

I would like to develop a simple and small game for WebXR so that Quest, Index, etc. can play it. I would eventually like to be able to put it on the Quest store and Steam. Is there a way to publish a ...
0 votes
0 answers
107 views

Using the standard three.js FPS example of octree implementation with a more advanced mesh, crashes the page on load. My first idea is to write a few functions to save the octee data to a file, then ...
0 votes
1 answer
262 views

I'm building a very basic 3D multiplayer game using Three.js and Socket.io where all the player does is move in an environment. Considering there will be ~ 100 players in a single room and all data ...
0 votes
1 answer
593 views

I'm looking at this three.js cubemap example, and it runs fine in my browser when loaded from that page. After much strain to find and download the files - it does not run? What am I doing wrong, with ...
0 votes
1 answer
187 views

Im creating a game with React and Three.js and vanilla Javascript, i have several clases, representing objects in the game, do i need to create a camera, scene, renderer for each class or i simply ...
1 vote
0 answers
638 views

Trying to get a "semi" realistic aircraft simulator. I'm pulling my hair out because I just can't get the math right. I'm not looking for super realistic but want to at least get some ...
0 votes
0 answers
132 views

In this three.js Text example they animate text, i am trying to implement it on React/Three.js but i got the error TypeError: can't access property "length", geometry.faces is undefined in ...
1 vote
2 answers
4k views

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 ...
0 votes
1 answer
186 views

So I have this plane generated with two different Perlin noises. It has mainly 3 regions, divided by color. I want to smooth out the lines, to create a "gradient" so there are no abrupt ...
1 vote
0 answers
126 views

I'm trying to calculate an uniformly accelerated rotation for the autopilot module in my 3d space game shooter. The autopilot should fly the spaceship to any given point in the 3d space on the ...
0 votes
1 answer
986 views

I've created this terrain based on a Voronoi noise function: This is how it looks without the elevation: I want to assign biomes to the polygons following certain rules and use the slope on the ...
0 votes
0 answers
59 views

I have this terrain I generated using Perlin Noise layers whose colors are applied based on the height of the vertex, just for reference before I am done being clear about how I will implement the ...
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 ...
1 vote
0 answers
258 views

Which of following approaches will have less performance overhead(using threejs renderer)? I am currently have an issue with z-fight for distant objects, while my near/far plane is already set to most ...
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" ...
0 votes
0 answers
234 views

I am trying visualize a human finger's pose with a 3D model in Three.js. The 3D model is composed of 3 bones that represent the proximal, middle, and distal bones of the human finger, connected in ...
1 vote
1 answer
2k views

I am trying to understand a way in THREE.JS (and the mathematical foundation) to get the direction an object should rotate to lookAt other but without actually rotate it. I've tried to use ...
0 votes
1 answer
64 views

Let's say we have two vectors A and B. Is there a way to use Three.js' Ray or Raycaster classes to cast a line between vector A and vector B and check is it passes through a mesh in the scene? I know ...
1 vote
0 answers
226 views

I wanted to understand - Is there a way where we can verify if certain image is 3D or not So basically I want to automate the process where we can detect if certain given image is of 3D or not Problem:...
0 votes
1 answer
1k views

I am moving a rigidbody (the character) on the surface of a sphere, like what is described here. I am facing the following issue that I am having hard time to solve: After moving the character, it ...
1 vote
1 answer
386 views

I am creating a FPS game online. I want the user to be able to use a sensitivity they are familiar with from games they've played. In this case, I want them to use their Fortnite sensitivity. I am ...
2 votes
0 answers
613 views

I created a ShaderMaterial to draw a box in three.js using the following key code: ...
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 ...
1 vote
0 answers
366 views

I would like to add bullet physics to a scene crated by the three.js editor. Where do I need to put the canon.js file in order to be able to access it's functions from the editor scripts? I ...
-1 votes
1 answer
2k views

what is the problem with linear interpolation? in update() in case this is animate() and when I call zoomCamera() in update() there is lerp with smooth but when I call here ...
0 votes
1 answer
1k views

So I have the following struct in C++, it gets updates with the values of an program that uses a camera in spectator mode: ...
0 votes
0 answers
515 views

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
0 answers
710 views

I seem to find only examples to use the raycaster with the camera, but none that just have a raycaster from Point A to Point B. I have a working raycaster, it retrieves my Helpers, Lines etc. but it ...
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 ...
0 votes
2 answers
2k views

I have a camera that is moved by changing its X and Z coordinates. However, the camera is rotated, so when an object moves by 1 unit in the world, the number of pixels it moves by isn't trivial to ...
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 ...
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 ...
0 votes
1 answer
277 views

I'm trying to make a rotation vertically and horizontally around a point at the same time but I'm not able to combine both. I have this formula for the horizontal rotation: ...
1 vote
0 answers
67 views

I'm working on a game in Three.js where I have a few variations of the same model in blender. What I want to achieve is that I'll load the model once with all the material settings, but then I'll ...
0 votes
0 answers
1k views

I'm currently trying to map a seamless texture onto a 3d wall object but when it comes to the edges of the texture there are visible artifacts. closeup: Here is the shader code i use for the texture ...
0 votes
2 answers
597 views

I have a scene where I have a terrain as a PlaneGeometry. And I'm trying to locate a building on it as Sprite. But I'm not able to put that building/sprite centered on the terrain without getting a ...
6 votes
2 answers
2k views

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
1 answer
3k views

I'm trying to make a 3rd person camera for a game with THREE.js and Physijs (if that's important), and so far I have set it up so that the camera follows behind the player using cos and sin etc. but I ...