简体   繁体   中英

How to create 3d effect with 2d engine - AndEngine

I want create the effect of throwing ball to distance like "paper toss", I understand that the ball should be smaller according to the distance, but is there something that do this effect or what is the name of this so i will search more info about it.

thanks.

Perspective . In a 3D engine this is typically achieved with something called a projection .

It looks like it's pretty easy to adapt AndEngine to do this: 3D Perspective Tutorial .

A simple approach is to scale the Sprite as it moves back in distance. Just treat the scale property as a Z depth. But beware of Z-sorting (when items in depth overlap). In a simple game like paper toss this will not be a problem. But for example, if your object passes through a hoop, you will find it gets hard to manage.

Look into the glTranslatef(), glScalef() and glRotatef() functions in OpenGL ES as you'll be using all of these to get the effect you're looking for.

You may get more answers on gamedev.stackexchange.com .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM