A
A
alkolove12019-07-08 11:06:56
3D
alkolove1, 2019-07-08 11:06:56

How to scale sprites with perspective shift?

Here, let's say

float centerX, centerY;
float offsetX, offsetY;
for (float i=0; i<10; i++){
scaleX=scaleY=i/10;
putSpr(centerY+offsetX*i, centerY+offsetY*i, scaleX, scaleY);
}

How in this case to make a more natural imitation of perspective? Not linear scaling, but exponential.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor Padalka, 2019-07-12
@ehs

I would draw a top view on a piece of paper and in this 2D projection I would indicate not the center of the sprite and its width, but also the camera point at the bottom of the piece of paper. There, already in geometry, you can write a formula.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question