Strange camera visualization [RESOLVED]
Posted: Sun Apr 26, 2009 5:17 pm
Hi Bepu, here's my new problem.
I load my own object (static objects that don't needed to move) by my own GameComponent and the physic simulated objects by the Draw method from the DisplayModel class (I copied this class from your example). I have this strange issue: As you can see, the cylinders are not correctly visualized. They are arranged in a pyramid.
Here's my Game Component to draw static objects:
Can you help me?
I load my own object (static objects that don't needed to move) by my own GameComponent and the physic simulated objects by the Draw method from the DisplayModel class (I copied this class from your example). I have this strange issue: As you can see, the cylinders are not correctly visualized. They are arranged in a pyramid.
Here's my Game Component to draw static objects:
Code: Select all
public class DisegnaScenografia : DrawableGameComponent
{
Gioco game;
Model modello;
string path;
Vector3 posizione;
public DisegnaScenografia(Gioco parGame, string parpath, Vector3 parPosizione)
:base(parGame)
{
game = parGame;
path = parpath;
posizione = parPosizione;
}
protected override void LoadContent()
{
modello = game.Content.Load<Model>(path);
base.LoadContent();
}
public override void Draw(GameTime gameTime)
{
foreach (ModelMesh mesh in modello.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.World = Matrix.CreateTranslation(posizione);
effect.View = variabili.view;
effect.Projection = variabili.projection;
}
mesh.Draw(SaveStateMode.SaveState);
}
base.Draw(gameTime);
}
}