Perspective Method and/or Math
hamhose
Member Posts: 12
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.
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
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.
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.
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 !