How to rotate a CatmullRomCurve3 and get the correct getPoint value?

Hi,

I have a CatmullRomCurve3 curve in a group which is rotated, but getPoint after rotation of that group is no longer correct.

Anyone know how to apply the rotation to the CatmullRomCurve3 vector3 points or is there a better way of rotating the CatmullRomCurve3 in the group and applying some equation to getPoint() to get the correct vector3 from it?

Thanks

Hi!
For some ideas, have a look at this topic: Camera + EllipseCurve

Thanks, interesting… Going down the rabbit hole to see what I can find :+1:

Pay attention to these lines in the animation loop:

  curve.getPointAt(t, v)
  cam.position.copy(v);
  cam.position.applyMatrix4(line.matrixWorld);

:+1: toying with apply Matrix4 tests now…

I’m not moving the camera but lets see what a few tests result in.

Yep, had a bit of fun with some alternatives, but yep, that was just what I needed :star2:

this.a = 0.5 + (Math.sin(this.t / 250) * 0.5);
this.targetCubePos = this.lookAtCurve.getPoint(this.a);
this.meshes.lookAtCube.position.copy(this.targetCubePos);
this.meshes.lookAtCube.applyMatrix4(this.lookAtCurve.line.matrixWorld)

Thanks :slight_smile:

1 Like