Questions tagged [three.js]
Three.js is a JavaScript 3D Library which makes use of WebGL
125 questions
0
votes
0
answers
107
views
Octree build time crashes page for complex mesh
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
264
views
Multiplayer game - Player position updates transmission pattern
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
189
views
Creating a Game in Three.js do i share camera, scene objects?
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 ...
0
votes
0
answers
132
views
Three.js Animate Text error geometry.faces
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 ...
0
votes
1
answer
186
views
Interpolate colors between vertex in a plane
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 ...
0
votes
0
answers
59
views
How should I modify my terrain according to the biome? [duplicate]
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
0
answers
234
views
How to calculate local orientation of child relative to parent from only global positions?
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 ...
0
votes
1
answer
718
views
Shade a box different colors for two ends with one material in Three.js
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
730
views
What is the best rate at which to send updates to clients for a first person shooter NodeJS WebSocket server?
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
710
views
Three js raycaster WITHOUT camera
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 ...
0
votes
0
answers
1k
views
OpenGL seamless repeated texture has artifacts on edges
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
1
answer
278
views
Combine rotation XZ (horizontal) with YZ (vertical). Math formula
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:
...
0
votes
1
answer
3k
views
Raycasting in three.js not working properly on ipad and touch devices
I am working on a 3D tool for desktop and iPad. Everything is working fine except for two issues:
Issue 1 - When I select a 3D object with the mouse and move it on an iPad (as opposed to on desktop, ...
0
votes
0
answers
246
views
How to position a 3D crosshair on an objects face and set its angles **outward** from objects face?
What I have right now, is a ray tracer for my cursor on my canvas, when I click on the object, it gets the vector of my selection in the 3D space on the object I had my mouse on.
The ray tracer ...
0
votes
1
answer
2k
views
Three.js recover camera values
When I start the script, camera has starting values. When I will move it and click button to set up startign values it is never same. What values I missed?
The best way, I suppose, it is to look at ...
0
votes
1
answer
886
views
Rotating pitch and yaw causes roll
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 ...
0
votes
1
answer
220
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
1
answer
353
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
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
342
views
How to add a JSON object / model into your whitestorm world / scene?
I am loading the object from my json file.
...
0
votes
1
answer
993
views
Shader to render objects with distance independent size
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 ...
0
votes
1
answer
2k
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 ...
-1
votes
1
answer
2k
views
threejs lerp and camera the animation is not smooth
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
...
-2
votes
1
answer
1k
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:
...
-3
votes
1
answer
333
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 ...