Author Topic: Get modelViewMatrix from object  (Read 2168 times)

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Get modelViewMatrix from object
« on: November 16, 2014, 12:50:53 pm »
Hi Egon,

Is there anyway to get modelViewMatrix from object? I need it for multiple sub-meshes location and direction (crowd animation with hardware skinning), so I can animate the submesh by using only one object to reduce drawcall.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Get modelViewMatrix from object
« Reply #1 on: November 16, 2014, 02:23:42 pm »
Translate the matrix returned by getWorldTransformation() by the negated camera position and multiply the resulting matrix with the camera's rotation matrix.

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: Get modelViewMatrix from object
« Reply #2 on: November 16, 2014, 03:00:21 pm »
It works like magic now! Thanks alot egon