All Questions
201
questions
0
votes
0
answers
20
views
The rotation point for the BabylonJS sprite
I recently encountered a problem with the Pivot method for BabylonJS frame sprites, it does not exist :D I would like to ask if anyone has encountered a similar problem and how to set the rotation ...
0
votes
0
answers
27
views
Calculate camera y position for horizon to be at a percentage of canvas height
I have the following three.js code that renders a cube hovering above a floor, with the camera looking at the cube:
let renderer, camera, scene, light, floor, cube;
init();
render();
function ...
0
votes
1
answer
40
views
Extracting Only the External Edges of Complex BufferGeometry in Three.js
I'm currently working on a project involving zone creation and collision detection using Three.js, where my application correctly handles collisions and generates a BufferGeometry as the outcome. My ...
1
vote
0
answers
69
views
Rotate Object between two points (Three JS)
ScreenShot I am trying to create a mesh that stetches between two other points (or meshes) and can't seem to get past the final hurdle of rotating the stretched mesh to the right location. It seems ...
0
votes
1
answer
136
views
Calculating a transformation matrix from corresponding points (ThreeJS)
I have two sets of three corresponding (x,y) points, a and b:
// (example values, not actual)
const a = [[1, 1], [2, 2], [3, 3]]
const b = [/* etc, same format as `a` */]
I'm using ThreeJS and trying ...
0
votes
0
answers
52
views
How to get direction of rotation from linear velocity of pendulum?
I have a class called Pendulum which has getters and setters allowing it to calculate its angle of rotation if given some inputs like: initial angle, current time (which is used to calculate dt), etc.
...
0
votes
1
answer
62
views
In THREE.js animate between two points on a sphere
Looking to figure out how to rotate a sphere to move one point on the sphere to where another point on the sphere is, similar to the image attached below.
A diagram of the intended motion
I have ...
0
votes
0
answers
127
views
Transformation of a cylinder with three.js
The HTML snippet below generates a rotating cylinder with three.js. The piece of code generating the animation is:
const O = new THREE.Vector3(0, 0, 0);
const alpha = Math.PI / 180;
const Malpha = new ...
2
votes
1
answer
202
views
Interpolate 3d colours three.js
I have a 3d mesh and 11 static points with predefined values for them. Points are represented as an array of positions in 3d space and values:
x: 0.3 y: 0.4, z: 0.5, value: 100,
x: 0.6 y: 0.9, z: 0....
0
votes
0
answers
63
views
How to find perpendicular point at given distance in ThreeJs
I have pointA and pointB in world coordinates. I want to find the pointC which will be perpendicular to line AB.
Due to my average math skills, I don't know how to find pointC. I searched on google ...
1
vote
1
answer
90
views
ThreeJS: Tweaking projection / raycasting
there is a very rough ThreeJS sketch with a cube at the Vector3(0.0, 0.0, 0.0) rotated with one edge to a viewer. Code gets some screen points from left/right edges, transforms them to 3D world ...
1
vote
0
answers
180
views
how to get the world y plane of the camera and [negate?] it
Im looking to set the value of y in the commented code cameraDir.y = 0; to be the y = 0 plane of the camera after q or e is pressed in if (input._keys.a)
// if (input._keys.a) {
_R.copy(this....
0
votes
1
answer
179
views
How to fill a box with boxGeometry randomly and no overlap?
I am using THREE.js in react.
I want to fill 500 number of 1X1X1 box geometry in a 200x200x200 area randomly.
The following code shows how to get the position.xyz with the range from -100 to 100.
...
0
votes
1
answer
84
views
I would like to simulate gravitation between particles, but I think I forgot something?
So, for each star, i compare this one to all other stars to calculate his speed, velocity, etc.
But that didn't work, I'm not too strong in maths and I think my formula is maybe wrong? idk why that ...
0
votes
0
answers
40
views
Create Plane on line with same angle it was making on another line?
I have one plane mesh which will be rotated by user for his desire orientation then I have line which I create so it will pass through that plane. Now user can rotate plane mesh using transform ...