Translating the model in 3D world is a basic operation of Windows Phone 7 games; you can move the game object from one place to another. Jumping, running, or crawling is based on the translation. In this recipe, you will learn how to gain the knowledge necessary to do this.
The following steps will show you how to do the basic and useful operations on 3D models Translation:
1. Create a Windows Phone Game project named
TranslateModel
, changeGame1.cs
toTranslateModelGame.cs
. Next, add the model fileball.fbx
and font filegameFont.spritefont
to the content project.2. Declare the variables for ball translation. Add the following lines to the
TranslateModelGame
class:// Sprite font for showing the notice message SpriteFont font; // The beginning offset at axis X float begin; // The ending offset at axis X float end; // the translation value at axis X float translation; // Ball model Model modelBall; // Ball model position Matrix worldBall...