Perspective Method and/or Math

I am totally new to Gamesalad, and I wanted to experiment with creating some perspective. The idea is a character is facing away from camera, walking forward down a road. The character stays put as it "walks" but instead the environment moves forward and grows. As a quickie test, I started a new game, created a trapezoid graphic, assigned it to an actor and put that actor in the game. My idea was as the "up" arrow is pressed, the actor would move slowly down the Y axis, and simultaneously grow in size in both height and width, to give the illusion of "coming at you." I figure the actor could just be repeated over and over to make it an infinite road for the character to walk down. I just guessed at the values, and while not perfect, there might be some potential in this method. But the math isn't right. When I both move and grow at a constant linear rate, the actor doesn't behave the way it should, and I can tell it's not just my guessed-at numbers. So .... two questions. Is there an easier, established way to achieve what I am trying to do but I am just too much of a noob to know what it is? Or, does anyone know what is (or where I can find) the proper math for the movement and growth to make this work?

I tried a variety of searches for "gamesalad" + "perspective" but all the results I got were people just giving their perspective on gamesalad. I usually try and research something before I post a question, but I wasn't finding what I need. So my apologies if this has been asked and answered before. And, of course, any help is appreciated.

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2013
    . . . . When I both move and grow at a constant linear rate, the actor doesn't behave the way it should, and I can tell it's not just my guessed-at numbers.
    An object approaching from a distance would appear to grow exponentially - rather than at a constant linear rate.

    For example imagine a 1m x 1m cube - a kilometre away - as it moves towards you . . . . if it were to move 1 metre towards you from 1 kilometre away (so it is now 999 metres away) its growth in size would be imperceivable - but if the same 1m x 1m cube was 2 metres away and moved 1 metre towards you then you'd see an enormous change in perceived size.

    So . . . growing an actor at a linear rate will just look as if the actor is getting bigger as the visual cue that something is approaching from a distance (exponential growth) is missing.

    Hold on, let me make you a demo . . . back in a minute.
  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2013
    Here you go (file attached) - a bit crude but you should get the idea - two buttons, red and blue, press red to see exponential growth, press blue to see linear growth.

    Something growing a linear rate - if put in the context of object moving towards you - will look like it is slowing down, but more often than not it will break the illusion of movement towards you - whereas exponential growth will always look more convincing.

  • SocksSocks London, UK.Member Posts: 12,822
    Another thought - my example above is dealing with object perfectly perpendicular to the viewer/camera - with your trapezoid graphic another issue comes into play . . .

    The more distant (from the viewer) end of the trapezoid should grow at a rate offset (negatively) from the front end (the end near the viewer) - imagine the trapezoid is 1 kilometre long, the distant end would have to grow less (at any particular moment) than the front end.

    Which all means you can't simply scale up a 2D drawing of a trapezoid (even scaling it exponentially) and get a realistic illusion of something existing in 3D space. You are probably better off breaking it up into parts that you are have control over individually.

    Hope all that makes sense !
  • SocksSocks London, UK.Member Posts: 12,822
    Another example:

  • hamhosehamhose Member Posts: 12
    Wow. Thanks for the examples. Yes, I see your point about exponential growth, and even more importantly about the different growth rates needed for the front and back of the trapezoid. My original idea was simply to create a square, and resize the back smaller than the front - but I realized this was not possible (as far as I could tell) with Gamesalad. That is why I decided to cheat using forced perspective with the trapezoid. I am going to experiment with chopping up the trapezoid into smaller pieces and have them cycle one after the other. My guess is they will never line up properly, again do to the front/back resize issue. While that might be visually unappealing when dealing with a simple, perfect trapezoid graphic, it may work if it is replaced with a cobblestone road or grassy path graphic where the edges are not so clean and perfect. Thanks for your suggestions!
Sign In or Register to comment.