# \#vector3

**URL:** https://forum.babylonjs.com/tag/vector3/134.md

[Latest](https://forum.babylonjs.com/latest.md) · [Categories](https://forum.babylonjs.com/categories.md) · [Tags](https://forum.babylonjs.com/tags.md)

---

## [Issue with Resetting Mesh Position When Using new Vector3 in Array](https://forum.babylonjs.com/t/issue-with-resetting-mesh-position-when-using-new-vector3-in-array/60144)

<div class="topic-metadata">

**Author:** [@mmhosein.hp](https://forum.babylonjs.com/u/mmhosein.hp)\
**Replies:** 6\
**Last updated:** [August 19, 2025, 1:56pm UTC](https://forum.babylonjs.com/t/issue-with-resetting-mesh-position-when-using-new-vector3-in-array/60144 "2025-08-19T13:56:26Z")

</div>

Hi everyone, I’m working on a Babylon.js scene with physics-enabled meshes. I want to reset the position of a mesh when I press the R key. I noticed something strange: When I store new BABYLON.Vector3 objects direct…

---

## [Single class that unifies Matrix, Vector2, Vector3, and Tensor functionality](https://forum.babylonjs.com/t/single-class-that-unifies-matrix-vector2-vector3-and-tensor-functionality/57747)

<div class="topic-metadata">

**Author:** [@HiGreg](https://forum.babylonjs.com/u/HiGreg)\
**Replies:** 0\
**Last updated:** [April 10, 2025, 2:26pm UTC](https://forum.babylonjs.com/t/single-class-that-unifies-matrix-vector2-vector3-and-tensor-functionality/57747 "2025-04-10T14:26:31Z")

</div>

This post is to assess the appetite for size-agnostic Matrix class proposal. For a new SVG2 class I’m working on, I wanted a few functions for calculating the (surprisingly complex) ArcTo SVG2 command. It was relativel…

---

## [Standardizing InPlace, ToNew, and ToRef for Matrix, Vector3, and Quaternion?](https://forum.babylonjs.com/t/standardizing-inplace-tonew-and-toref-for-matrix-vector3-and-quaternion/54011)

<div class="topic-metadata">

**Author:** [@HiGreg](https://forum.babylonjs.com/u/HiGreg)\
**Replies:** 4\
**Last updated:** [October 8, 2024, 11:55pm UTC](https://forum.babylonjs.com/t/standardizing-inplace-tonew-and-toref-for-matrix-vector3-and-quaternion/54011 "2024-10-08T23:55:00Z")

</div>

Is there any leaning toward standardizing the “plain” functions and whether they are InPlace or ToNew? Or is there too much code that is dependent on the current functionality? In another thread: I was just reviewing…

---

## [Fix Vector3's method compatibility with IVector3Like](https://forum.babylonjs.com/t/fix-vector3s-method-compatibility-with-ivector3like/52593)

<div class="topic-metadata">

**Author:** [@Vortex](https://forum.babylonjs.com/u/Vortex)\
**Replies:** 26\
**Last updated:** [August 7, 2024, 9:45pm UTC](https://forum.babylonjs.com/t/fix-vector3s-method-compatibility-with-ivector3like/52593 "2024-08-07T21:45:29Z")

</div>

Currently, Vector3 has some strange behavior when compared to other vector and color classes. It is the only vector/color class that uses internal coordinates (\_x, \_y, \_z) and tracks when they are updated. All of its met…

---

## [Decals and angle](https://forum.babylonjs.com/t/decals-and-angle/52349)

<div class="topic-metadata">

**Author:** [@simon](https://forum.babylonjs.com/u/simon)\
**Replies:** 17\
**Last updated:** [July 29, 2024, 9:35pm UTC](https://forum.babylonjs.com/t/decals-and-angle/52349 "2024-07-29T21:35:11Z")

</div>

Hello! I have a problem. I try to create a decal for mesh from the plane. And it is pretty simple until we will not try to rotate decal corresponding to mesh rotation. I attach the playground here: It is without sett…

---

## [How to set the rotation of ArcRotateCamera based on mesh direction when animation starts](https://forum.babylonjs.com/t/how-to-set-the-rotation-of-arcrotatecamera-based-on-mesh-direction-when-animation-starts/50539)

<div class="topic-metadata">

**Author:** [@ToucheToucan](https://forum.babylonjs.com/u/ToucheToucan)\
**Replies:** 2\
**Last updated:** [May 16, 2024, 2:48pm UTC](https://forum.babylonjs.com/t/how-to-set-the-rotation-of-arcrotatecamera-based-on-mesh-direction-when-animation-starts/50539 "2024-05-16T14:48:31Z")

</div>

Hello. I’m working on a project where we import a lot of animations to animate an avatar. Sadly not all animations face the same direction and I would like the camera to start of facing the front of the avatar each time …

---

## [How to rotate with physics applied and with parent-child relationship](https://forum.babylonjs.com/t/how-to-rotate-with-physics-applied-and-with-parent-child-relationship/48008)

<div class="topic-metadata">

**Author:** [@Octo8080X](https://forum.babylonjs.com/u/Octo8080X)\
**Replies:** 7\
**Last updated:** [February 14, 2024, 4:56pm UTC](https://forum.babylonjs.com/t/how-to-rotate-with-physics-applied-and-with-parent-child-relationship/48008 "2024-02-14T16:56:58Z")

</div>

We want to rotate a child by reflecting the parent rotation generated by Constraint to the child. In addition, we would like to make the object output only up to a certain angular velocity when it rotates. It has taken…

---

## [How to initially place objects assuming a constraint](https://forum.babylonjs.com/t/how-to-initially-place-objects-assuming-a-constraint/47895)

<div class="topic-metadata">

**Author:** [@Octo8080X](https://forum.babylonjs.com/u/Octo8080X)\
**Replies:** 4\
**Last updated:** [February 8, 2024, 11:51am UTC](https://forum.babylonjs.com/t/how-to-initially-place-objects-assuming-a-constraint/47895 "2024-02-08T11:51:17Z")

</div>

When connecting objects with Constraint, such as HingeConstraint, if the initial placement is not set up well, the objects often scatter with the momentum of moving to the connection position. As a countermeasure, we wa…

---

## [How to determine the end point of LerpToRef?](https://forum.babylonjs.com/t/how-to-determine-the-end-point-of-lerptoref/47248)

<div class="topic-metadata">

**Author:** [@late-autumn-give-ear](https://forum.babylonjs.com/u/late-autumn-give-ear)\
**Replies:** 2\
**Last updated:** [January 16, 2024, 8:47am UTC](https://forum.babylonjs.com/t/how-to-determine-the-end-point-of-lerptoref/47248 "2024-01-16T08:47:48Z")

</div>

This might be a silly question. I want the sphere to do something after the LerpToRef.Is there a way to do this if I don’t use Animation and just rely on LerpToRef? thanks a lot！

---

## [Vector3 movement not working for me](https://forum.babylonjs.com/t/vector3-movement-not-working-for-me/46839)

<div class="topic-metadata">

**Author:** [@Mhmod](https://forum.babylonjs.com/u/Mhmod)\
**Replies:** 12\
**Last updated:** [January 3, 2024, 6:50pm UTC](https://forum.babylonjs.com/t/vector3-movement-not-working-for-me/46839 "2024-01-03T18:50:11Z")

</div>

I have this code that moves the player (a cube mesh) depending on the key pressed, heres a simplified version: notes: moveDir is a Vector3 moveDir.addInPlaceFromFloats(-1 \* engine.getDeltaTime(), 0, 0); moveDir.normal…

---

## [Producing Quaternion between vectors](https://forum.babylonjs.com/t/producing-quaternion-between-vectors/46841)

<div class="topic-metadata">

**Author:** [@DavidP](https://forum.babylonjs.com/u/DavidP)\
**Replies:** 4\
**Last updated:** [January 3, 2024, 1:35am UTC](https://forum.babylonjs.com/t/producing-quaternion-between-vectors/46841 "2024-01-03T01:35:19Z")

</div>

Hello, In the example below I compute a quaternion of rotation from U vector to V vector. After that, I create a new vector U2 that is initialized to U and then rotated by the quaternion. Thus U2 should be V, but that i…

---

## [Dual Virtual Joystick for rotate ( left ) and move ( right ) in a First-Person Perspective 3D Room](https://forum.babylonjs.com/t/dual-virtual-joystick-for-rotate-left-and-move-right-in-a-first-person-perspective-3d-room/45090)

<div class="topic-metadata">

**Author:** [@papayalabs](https://forum.babylonjs.com/u/papayalabs)\
**Replies:** 3\
**Last updated:** [October 25, 2023, 3:55pm UTC](https://forum.babylonjs.com/t/dual-virtual-joystick-for-rotate-left-and-move-right-in-a-first-person-perspective-3d-room/45090 "2023-10-25T15:55:19Z")

</div>

I built this first-person perspective 3D room with a dual VirtualJoystick (left to rotate and right to move) (https://playground.babylonjs.com/#R7KZRR#1). And it works fine in the player’s initial position, but as soon a…

---

## [Position a mesh to follow DOM element's position](https://forum.babylonjs.com/t/position-a-mesh-to-follow-dom-elements-position/44127)

<div class="topic-metadata">

**Author:** [@Antony](https://forum.babylonjs.com/u/Antony)\
**Replies:** 4\
**Last updated:** [September 16, 2023, 1:15am UTC](https://forum.babylonjs.com/t/position-a-mesh-to-follow-dom-elements-position/44127 "2023-09-16T01:15:06Z")

</div>

Hello everyone, I’m trying to write a program to fit a mesh into a DOM element’s bounds. I firstly use the orthographic camera mode so its perspective is closer to a 2D one. I searched the calculation of how to calculat…

---

## [Weird lerp behaviour on tab refocus. Camera incorrectly positioned on refocus](https://forum.babylonjs.com/t/weird-lerp-behaviour-on-tab-refocus-camera-incorrectly-positioned-on-refocus/43534)

<div class="topic-metadata">

**Author:** [@Jannick](https://forum.babylonjs.com/u/Jannick)\
**Replies:** 4\
**Last updated:** [August 28, 2023, 2:34pm UTC](https://forum.babylonjs.com/t/weird-lerp-behaviour-on-tab-refocus-camera-incorrectly-positioned-on-refocus/43534 "2023-08-28T14:34:03Z")

</div>

Hello again! I’ve found this very odd behaviour, it happens when the browser tab refocuses (clicking another tab, waiting a couple of seconds, then going back to the playground / babylon rendering canvas) It’s particul…

---

## [Vector operation issue](https://forum.babylonjs.com/t/vector-operation-issue/43302)

<div class="topic-metadata">

**Author:** [@Chan\_PlusPlus](https://forum.babylonjs.com/u/Chan_PlusPlus)\
**Replies:** 2\
**Last updated:** [August 18, 2023, 5:07am UTC](https://forum.babylonjs.com/t/vector-operation-issue/43302 "2023-08-18T05:07:26Z")

</div>

The below function is for the purpose of updating player’s position UpdatePosition(deltaTime: number) { if (!this.\_player) { return; } const velocity = this.\_velocity; const frameDecceleration = n…

---

## [Vector3.Normalize returns is not accurate result](https://forum.babylonjs.com/t/vector3-normalize-returns-is-not-accurate-result/43229)

<div class="topic-metadata">

**Author:** [@deslancers](https://forum.babylonjs.com/u/deslancers)\
**Replies:** 5\
**Last updated:** [August 11, 2023, 11:37am UTC](https://forum.babylonjs.com/t/vector3-normalize-returns-is-not-accurate-result/43229 "2023-08-11T11:37:03Z")

</div>

Hello community! Today i found strange “bug?” with Vector3 method normalize, that method in some cases returns is not accurate result and i don’t know why and how to fix it, please help. you can see result in this PG …

---

## [Need to fix this Homing missile animation](https://forum.babylonjs.com/t/need-to-fix-this-homing-missile-animation/40237)

<div class="topic-metadata">

**Author:** [@steelx](https://forum.babylonjs.com/u/steelx)\
**Replies:** 12\
**Last updated:** [May 3, 2023, 5:20am UTC](https://forum.babylonjs.com/t/need-to-fix-this-homing-missile-animation/40237 "2023-05-03T05:20:03Z")

</div>

at the moment it doesnt feel right. DEMO video: code: import { StandardMaterial, Color3, SphereParticleEmitter, ParticleSystem, Texture, Vector3, Quaternion, Animation, CreateCapsuleVertexData,…

---

## [Rotate a Vector3 by another](https://forum.babylonjs.com/t/rotate-a-vector3-by-another/38104)

<div class="topic-metadata">

**Author:** [@Vortex](https://forum.babylonjs.com/u/Vortex)\
**Replies:** 2\
**Last updated:** [February 10, 2023, 9:47pm UTC](https://forum.babylonjs.com/t/rotate-a-vector3-by-another/38104 "2023-02-10T21:47:19Z")

</div>

I’m trying to have something similar to getDirection. For example: const position = Vector3.Zero(), rotation = new Vector3(0, Math.PI / 2, 0), toAdd = Vector3.Forward(); const rotated = toAdd.rotateByVecto…

---

## [Optimizing performance of FromArrayToRef](https://forum.babylonjs.com/t/optimizing-performance-of-fromarraytoref/37513)

<div class="topic-metadata">

**Author:** [@kzhsw](https://forum.babylonjs.com/u/kzhsw)\
**Replies:** 11\
**Last updated:** [January 27, 2023, 7:20am UTC](https://forum.babylonjs.com/t/optimizing-performance-of-fromarraytoref/37513 "2023-01-27T07:20:45Z")

</div>

In vector functions like Vector3.FromArrayToRef and Quaternion.FromArrayToRef, values are assigned to properites like x, y, z, w, which are internally setter functions which sets things like \_x and \_isDirty, so in FromAr…

---

## [What are the Feasible Limits for Vectors, Meshes, Animations, etc. in a BabylonJS Project?](https://forum.babylonjs.com/t/what-are-the-feasible-limits-for-vectors-meshes-animations-etc-in-a-babylonjs-project/37457)

<div class="topic-metadata">

**Author:** [@Gamedev](https://forum.babylonjs.com/u/Gamedev)\
**Replies:** 2\
**Last updated:** [January 17, 2023, 4:39pm UTC](https://forum.babylonjs.com/t/what-are-the-feasible-limits-for-vectors-meshes-animations-etc-in-a-babylonjs-project/37457 "2023-01-17T16:39:27Z")

</div>

Can some of you guys please share some of your experiences on this? When building a BabylonJS scene, it’s important to consider the limits of what is feasible in terms of the number of Vectors, Meshes, Animations, etc. …

---

## [How to calculate box rotation from array of points?](https://forum.babylonjs.com/t/how-to-calculate-box-rotation-from-array-of-points/37222)

<div class="topic-metadata">

**Author:** [@Chev](https://forum.babylonjs.com/u/Chev)\
**Replies:** 4\
**Last updated:** [January 10, 2023, 4:15pm UTC](https://forum.babylonjs.com/t/how-to-calculate-box-rotation-from-array-of-points/37222 "2023-01-10T16:15:18Z")

</div>

Hello, I’m a bit new to working with 3D space and rotation. I have a list of four Vector3 points that represent the corners of a rectangle. What I want to do is use those points to create a box mesh that is rotated to ex…

---

## [What is the default unit in BabylonJS, if any? ( is 1 Vector = 1 meter? )](https://forum.babylonjs.com/t/what-is-the-default-unit-in-babylonjs-if-any-is-1-vector-1-meter/37094)

<div class="topic-metadata">

**Author:** [@Gamedev](https://forum.babylonjs.com/u/Gamedev)\
**Replies:** 3\
**Last updated:** [January 4, 2023, 8:02pm UTC](https://forum.babylonjs.com/t/what-is-the-default-unit-in-babylonjs-if-any-is-1-vector-1-meter/37094 "2023-01-04T20:02:32Z")

</div>

I’ve only started very recently experimenting with BabylonJS Is there any default unit in BabylonJS for 1 Vector ( = I mean, the distance between 2 vectors )? Like, is it the distance between 2 Vector3’s supposedly 1 m…

---

## [Rotate a Vector3](https://forum.babylonjs.com/t/rotate-a-vector3/36890)

<div class="topic-metadata">

**Author:** [@Vortex](https://forum.babylonjs.com/u/Vortex)\
**Replies:** 5\
**Last updated:** [December 26, 2022, 9:35pm UTC](https://forum.babylonjs.com/t/rotate-a-vector3/36890 "2022-12-26T21:35:47Z")

</div>

I have a project where I’m trying to connect to different components of a structure (space station). Each component has an array of connectors with a position and rotation that should be applied to the connected compone…

---

## [Hierarchybounding vectors min & max along an axis](https://forum.babylonjs.com/t/hierarchybounding-vectors-min-max-along-an-axis/36604)

<div class="topic-metadata">

**Author:** [@evidanary](https://forum.babylonjs.com/u/evidanary)\
**Replies:** 1\
**Last updated:** [December 16, 2022, 12:00pm UTC](https://forum.babylonjs.com/t/hierarchybounding-vectors-min-max-along-an-axis/36604 "2022-12-16T12:00:50Z")

</div>

I have a GLTF scene mesh which has one or more tables that are touching a wall. The wall can be arbitrarily placed anywhere in the scene. The normal of the wall is known. Now, I’d like to place items on the table from l…

---

## [Camera return wrong upVector](https://forum.babylonjs.com/t/camera-return-wrong-upvector/36334)

<div class="topic-metadata">

**Author:** [@wsAndy](https://forum.babylonjs.com/u/wsAndy)\
**Replies:** 1\
**Last updated:** [December 7, 2022, 10:22am UTC](https://forum.babylonjs.com/t/camera-return-wrong-upvector/36334 "2022-12-07T10:22:45Z")

</div>

Hello everyone! I get the camera’s upVector by camera.upVector, and it is Vector3(0, 1, 0) by default. But when I read the source code in targetCamera.ts, I find that the function \_rotateUpVectorWithCameraRotationMatri…

---

## [Meshes position with same Vector3 lerps only one Mesh](https://forum.babylonjs.com/t/meshes-position-with-same-vector3-lerps-only-one-mesh/35522)

<div class="topic-metadata">

**Author:** [@Takemura](https://forum.babylonjs.com/u/Takemura)\
**Replies:** 7\
**Last updated:** [November 8, 2022, 11:26pm UTC](https://forum.babylonjs.com/t/meshes-position-with-same-vector3-lerps-only-one-mesh/35522 "2022-11-08T23:26:57Z")

</div>

Lovely community, I encountered a strange behaviour, when I set position of one mesh as position of another and then lerp it, it will only move one of the meshes. Unfortunately for me, it is even the wrong mesh thats po…

---

## [Calculate offset position of plane based on camera and fixed plane position](https://forum.babylonjs.com/t/calculate-offset-position-of-plane-based-on-camera-and-fixed-plane-position/33183)

<div class="topic-metadata">

**Author:** [@Noires](https://forum.babylonjs.com/u/Noires)\
**Replies:** 4\
**Last updated:** [August 22, 2022, 1:19pm UTC](https://forum.babylonjs.com/t/calculate-offset-position-of-plane-based-on-camera-and-fixed-plane-position/33183 "2022-08-22T13:19:11Z")

</div>

I have the following situation (Babylon.js Playground): An ArcRotateCamera which looks at a plane (gray) and next to the plane another plane (purple) is placed. The camera position is known. The plane (gray) position i…

---

## [Vector3.Project incorrectly projects behind/inverse](https://forum.babylonjs.com/t/vector3-project-incorrectly-projects-behind-inverse/30601)

<div class="topic-metadata">

**Author:** [@Vortex](https://forum.babylonjs.com/u/Vortex)\
**Replies:** 8\
**Last updated:** [August 8, 2022, 6:38am UTC](https://forum.babylonjs.com/t/vector3-project-incorrectly-projects-behind-inverse/30601 "2022-08-08T06:38:11Z")

</div>

As the title says, Vector3.Project will not give the right cordinates if the point is behind the camera. Here is a PG Repro: Turn around to see the marker being displayed at the incorrect point.

---

## [What is the correct way of using Lerp with deltaTime correction?](https://forum.babylonjs.com/t/what-is-the-correct-way-of-using-lerp-with-deltatime-correction/32350)

<div class="topic-metadata">

**Author:** [@TiagoSilvaPereira](https://forum.babylonjs.com/u/TiagoSilvaPereira)\
**Replies:** 6\
**Last updated:** [July 22, 2022, 12:15pm UTC](https://forum.babylonjs.com/t/what-is-the-correct-way-of-using-lerp-with-deltatime-correction/32350 "2022-07-22T12:15:58Z")

</div>

Hi everyone, I hope you are all fine! I’m creating a small Arcade Flight simulator, and I’m using Lerp to do some rotations, for example: let pitchAngle = BABYLON.Angle.FromDegrees(40).radians(); pitch = BABYLON.Scalar…

---

## [N00b question on why calling .x on Vector3 shows different values in console log](https://forum.babylonjs.com/t/n00b-question-on-why-calling-x-on-vector3-shows-different-values-in-console-log/30580)

<div class="topic-metadata">

**Author:** [@evidanary](https://forum.babylonjs.com/u/evidanary)\
**Replies:** 3\
**Last updated:** [June 15, 2022, 2:50pm UTC](https://forum.babylonjs.com/t/n00b-question-on-why-calling-x-on-vector3-shows-different-values-in-console-log/30580 "2022-06-15T14:50:30Z")

</div>

I have a left wall, right wall and floor in my scene. I have a left shelf which is attached to the left wall. Now, I’m trying to place objects on the left shelf. For that I wanted to get the bottom corner of the shelf f…

[Next page](https://forum.babylonjs.com/tag/vector3/134.md?match_all_tags=true&page=1&tags%5B%5D=vector3)
