Author Topic: How to set camera lookAt?  (Read 1792 times)

Offline ramzes0071

  • byte
  • *
  • Posts: 11
    • View Profile
How to set camera lookAt?
« on: July 13, 2013, 12:22:07 pm »
Hi,
I'm writing to you because I don't know how to set camera.lookAt property on my object3D. I have route composed of several parts. Each is object3d.
My routelooks like this

http://drspikecook.com/files/2012/02/istock_winding_road-1jdvrl0.jpg

Each part is responsible for part of the route. If is no longer visible is move at the end of route. So how to set lookAt to this route.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: How to set camera lookAt?
« Reply #1 on: July 13, 2013, 11:28:55 pm »
Not trivial...are these road parts rotated in the direction in which the road points or is that rotation baked into the geometry itself.

Offline ramzes0071

  • byte
  • *
  • Posts: 11
    • View Profile
Re: How to set camera lookAt?
« Reply #2 on: July 14, 2013, 12:24:17 pm »
Road parts are rotated in the right direction.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: How to set camera lookAt?
« Reply #3 on: July 14, 2013, 09:21:58 pm »
In that case, you migh tbe able to combine the transformed center of each part in combination with the result one of the get?Axis()-methods in Object3D and some crude interpolation to something that works well enough.