All Questions
Tagged with three.js javascript
42 questions
0
votes
0
answers
46
views
How can I map out multiple decals on a reel?
So I want to map out multiple Decals on this reel. How can I map it out aesthetically and mathematically correct ?
Looking for a math god to help me with this calculation.
So far I have hardcoded the ...
1
vote
2
answers
311
views
How to publish WebXR game on Quest or Steam stores?
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
95
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
212
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
157
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 ...
1
vote
0
answers
518
views
Aircraft simulation
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
123
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
165
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
1
answer
801
views
Assign biomes to areas with a Voronoi noise function
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
50
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
1
answer
38
views
How to check if a line casted from one point to another point passes through a mesh?
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 ...
0
votes
1
answer
532
views
How to import three.module.js
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 ...
1
vote
0
answers
348
views
How can I use canon.js in three.js editor?
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
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
...
1
vote
1
answer
349
views
Camera Sensitivity in PointerLockControls to match actual games
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 ...
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
1
answer
282
views
Finding the closest face normal from a given point in space efficiently
I have a large model (roughly 400k faces) and a large number of points on this model (roughly 2000) and I need to calculate a normal per point based on the closest face on the model. Is there a faster ...
0
votes
1
answer
1k
views
Set custom Yaw Pitch and Roll in Three.js
So I have the following struct in C++, it gets updates with the values of an program that uses a camera in spectator mode:
...
1
vote
1
answer
894
views
Throw ball - distance and force
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 ...
0
votes
1
answer
1k
views
How would I process accelerometer data to use it for camera rotation?
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 <...
2
votes
1
answer
908
views
Sorting sprites above the surface of 3D mesh?
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 ...
4
votes
4
answers
10k
views
Three.js— how to rotate sphere without moving light (using OrbitControls)?
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
64
views
align local Y to be parallel with global Y during or after slerp
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 ...
3
votes
0
answers
739
views
My collision detection is not working when I rotate my mesh in three.js
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 ...
4
votes
1
answer
144
views
Timers and performance for mobile JS
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 ...
0
votes
1
answer
3k
views
How can I export a model from Unity to three.js?
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 ...
0
votes
1
answer
3k
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 ...
-3
votes
1
answer
320
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
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 ...
0
votes
1
answer
197
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 ...
1
vote
1
answer
2k
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 ...
2
votes
1
answer
3k
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:
...
0
votes
2
answers
6k
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
1
answer
291
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
1
answer
765
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 ...
6
votes
2
answers
2k
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:
...
1
vote
2
answers
4k
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
1
answer
262
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
0
answers
261
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 ...
2
votes
2
answers
10k
views
How to handle 3D collisions using raycasting (with a reflection vector?)
I'm making a game using THREE.JS, and I want my character to walk on the terrain, and collide with static 3D objects (=AABB boxes) that are on that terrain.
The problem is: THREE.JS has only a ...
3
votes
2
answers
6k
views
Quaternions - how to limit axis?
Is there any possibility to limit quaternions to move only in x & y axis (like in Eulers- yaw and pitch, without rolling)? I's there any equation or something similar to do this?
Some example:
...
3
votes
1
answer
13k
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.
<...