Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Change perspective  (Read 1341 times)

0 Members and 1 Guest are viewing this topic.

starkhorn

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • Email
Change perspective
« on: February 27, 2016, 12:39:01 am »
So I have a collection of 2D image which are essentially regions of Europe. i.e. one image for Ireland, another for France etc.

I can load these as a vector of textures, set a sprite to use these textures and I can draw them perfectly fine.

However the image looks like it is shown directly above each region. What I am aiming is to change the perspective so it looks like the map is sitting on a table, so it looks like a board-game sitting on a table. I see in GIMP there is a perspective tool but I am finding it a bit hard to get exact look for each individual region. (I've over 50-60 images to change).

So I was wondering if there was some easy way to change/stretch the sprite so that the perspective changes.

Mr_Blame

  • Full Member
  • ***
  • Posts: 192
    • View Profile
    • Email
Re: Change perspective
« Reply #1 on: February 27, 2016, 07:08:38 am »
sounds like some direct opengl code for 3D.  :P

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10838
    • View Profile
    • development blog
    • Email
Re: Change perspective
« Reply #2 on: February 27, 2016, 12:27:27 pm »
Or you could take a look at Hapax's Sprite 3D, but even then you'll have to figure out the perspective for each image, so you'll have to ask yourself if it isn't easier to just do it in GIMP after all. ;)
« Last Edit: February 28, 2016, 12:47:57 am by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Hapax

  • Hero Member
  • *****
  • Posts: 3353
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Change perspective
« Reply #3 on: February 28, 2016, 12:31:09 am »
Thanks for mentioning that, eXpl0it3r  :)

With Sprite 3D, if you set the origins to match globally:

(all objects have their origin set at where the green circle is at the bottom - origins don't have to be within the bounds of their object)

then, rotate causes them to all rotate around that same point:


Additionally, you have the option of specifying an origin's z position too, which can be useful to create depth after rotation.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*