Hello,
I’d like to move an object in a 3D world then compute the intersection between this object and a plane.
The issue I’m faced with is that the geometry I get after having moved the object seems to be the geometry before the move.
The main part of my code is as follow:
let currentObject2D = this.scene2D.getObjectByName(nom)
if (currentObject2D !== undefined) {
if (currentObject2D.position.y < 30) {
currentObject2D.position.y += 1
currentObject2D.updateMatrix()
}
Then:
const objetPositionAttribute = currentObject2D.geometry.getAttribute('position')
for (let vertexIndex = 0; vertexIndex < objetPositionAttribute.count; vertexIndex += 3) {
localVertex.fromBufferAttribute(objetPositionAttribute, vertexIndex)
objet.localToWorld(a.copy(localVertex))
Here the a vector is the position of this array before the translation.
Should I use promises?
Can you explain what I’m doing wrong please?