Game Development Community

3D models in Torque X 3.1.5 2D

by Stephen Stalker · in Torque X 2D · 08/30/2010 (9:24 pm) · 2 replies

OK I'm having a bit of trouble following the instructions in the Torque book and also posted at
www.torquepowered.com/community/forums/viewthread/74853.

I've created Starter Game 2D(3.1.5) Pro and followed all the steps outlined. All my files are in the Shapes subfolder and the .dts files are marked Build Action: Content and Copy to Output: Copy Always
#region Public Methods
        public static void Main()
        {
            // Create the static game instance.  
            _myGame = new Game();

            // begin the game.  Further setup is done in BeginRun()
            _myGame.Run();
        }

        public void CreatePlayer()
        {
            T2DShape3D shape = new T2DShape3D();
            shape.Name = "Player";
            shape.SetShape(@"data\shapes\boombot\orange_player.dts");
            shape.ShapeScale = new Microsoft.Xna.Framework.Vector3(10);
            shape.Components.AddComponent(new MovementComponent());
            shape.Components.AddComponent(new T2DPhysicsComponent());
            shape.SetPosition(Vector2.Zero, true);
            shape.Layer = 0;
            //rotate the model to face camera
            shape.Rotation2 = new Vector3(0, 90, 15);

            TorqueObjectDatabase.Instance.Register(shape);
        }

        #endregion

Is there something really obvious I've just missed or is there a problem with the current version of Torque X?

#1
08/31/2010 (5:53 pm)
You didn't really state what the problem is. Is the shape not showing up in the level?

Also, are you calling CreatePlayer() somewhere in the startup routine?
#2
08/31/2010 (6:30 pm)
Whoops! Yes, the problem is that the shape is not showing up.

I'm calling public void CreatePlayer()