I have some images, and I want to be able to fake a 3d world using them. Basicly, I want the image to change in size depending on the elevation of the image. I don't mind using Direct X, otherwise I will be using bitblt and the simlar resizing APIs.
Printable View
I have some images, and I want to be able to fake a 3d world using them. Basicly, I want the image to change in size depending on the elevation of the image. I don't mind using Direct X, otherwise I will be using bitblt and the simlar resizing APIs.
Well to resize things you could just use StretchBlt()
I know, but How would I do the math?
Define your vanishing point (the horizon). Let's say it's 500
(whatever units of distance) Nothing beyond 500 can be seen.
Size is linearly proportional to distance. so in this example,
something 100 units away is 80% of it's original size.
Assume vanishingPoint = 500 or any number you want.
Code:
Function spriteSize(SpriteHeight as Single, Distance as single) as Single
spriteSize = 0
if Distance < VanishingPoint then
spriteSize = SpriteHeight *(( VansihingPoint - Distance) /Distance )
end if
Thanks. Any ideas where to get pictures for games?
Make your own! :D Then the game is genuinely yours.Quote:
Originally posted by Gaming_World
Thanks. Any ideas where to get pictures for games?
I would, except that I suck at art.