Hello Guest

Author Topic: Is it better to pan the map or camera ?? which is the best approach?  (Read 4832 times)

RakeshChatra

  • Newbie
  • *
  • Posts: 33
    • View Profile
Hi, i am trying to pan a world map which of size 1024*768. I want the map to move left and right depending on touch directions. I have tried panning by instantiating 2 maps on either side of the center map and making it to shift the positions. But the problem is i am making many changes on the center map and these changes should be made to other maps also at runtime which is a hectic job.. Can somebody who has already worked on this. How to achieve the panning of map using camera. thanx in advance..

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Is it better to pan the map or camera ?? which is the best approach?
« Reply #1 on: December 27, 2013, 12:57:37 pm »
Its better to move the camera, you'll be moving more game objects otherwise. To pan with the camera, simply apply the same inverse transform to the camera instead of the objects.

RakeshChatra

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: Is it better to pan the map or camera ?? which is the best approach?
« Reply #2 on: January 02, 2014, 10:53:14 am »
thank you unikron for replying.. but how make the invers e transform for the camera ?? should i use 3 camera instead of 3 maps one at the centre one at the left end and one at the right end ???

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Is it better to pan the map or camera ?? which is the best approach?
« Reply #3 on: January 02, 2014, 05:43:59 pm »
Yeah you can do that if you want. This is pretty much open ended really - this might be a really easy way to do it, with some masking for each camera (using viewports, etc) you should be able to get decent results.