Forum

Author Topic: Transform between coordinate systems  (Read 1328 times)

szaman

  • Newbie
  • *
  • Posts: 2
    • View Profile
Transform between coordinate systems
« on: September 30, 2020, 03:14:26 PM »
Hi,
I would like to position the region in referenced scene. When I do:
chunk.region.center= Metashape.Vector([0,0,0])
it goes to wrong place.
I managed to position it correctly by:
chunk.region.center=  (chunk.transform.rotation.inv()  *  ((-chunk.transform.translation + center)/chunk.transform.scale))

Is there better/neater way to do this, to calculate region position in referenced coordinates?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14816
    • View Profile
Re: Transform between coordinate systems
« Reply #1 on: September 30, 2020, 06:24:29 PM »
Hello szaman,

Is the chunk referenced in local or geographic coordinates?

In the first case I assume that the following line should solve the problem:
Code: [Select]
chunk.region.center = chunk.transform.matrix.inv().mulp(Metashape.Vector([0,0,0]))
Best regards,
Alexey Pasumansky,
Agisoft LLC