官术网_书友最值得收藏!

Dealing with the third dimension

The first question that is likely to come to mind when it is suggested to use 3D models in what is advertised as a 2D engine is whether or not this will make the game engine into a 3D engine. The brief answer here is "No."

The longer answer is that despite the presence of these models, the engine's camera and other features are not aware of this third dimension, and so they will not be able to deal with it. It's not unlike the ray-casting engine employed by titles such as Wolfenstein 3D, which always operated in a horizontal plane and, by default, was not capable of tilting the camera to look up or down. This does imply that AndEngine can be turned into a 3D engine if all of its classes are adapted to deal with another dimension.

We're not going that far here, however. All that we are interested in right now is integrating 3D model support into the existing framework. For this, we need a number of things. The most important one is to be able to load these models. The second is to render them in such a way that we can use them within the AndEngine framework.

As we explored earlier, the way of integrating 3D models into a 2D scene is by realizing that a model is just a very large collection of possible sprites. What we need is a camera so that we can orient it relative to the model, similar to how the camera in a 3D engine works. We can then display the model from the orientation.

Any further manipulations, such as scaling and scene-wide transformations, are performed on the model's camera configuration. The model is only manipulated to obtain a new orientation or frame of an animation.

主站蜘蛛池模板: 绿春县| 嘉黎县| 泰和县| 新田县| 吴旗县| 文安县| 博野县| 五河县| 多伦县| 湖南省| 黄梅县| 五河县| 友谊县| 广灵县| 山阳县| 晋中市| 自贡市| 兴宁市| 久治县| 宁津县| 浠水县| 阜南县| 八宿县| 涞源县| 武威市| 临沂市| 阳信县| 潜江市| 翁源县| 旬邑县| 石屏县| 天全县| 蕉岭县| 汾阳市| 郯城县| 枞阳县| 方山县| 新河县| 灌云县| 吉隆县| 台中市|