Ejemplo n.º 1
0
        private void Init(GraphicsDevice g, Matrix Projection)
        {
            ObjectEffect.AmbientLightColor              = new Vector3(1, 0.5f, 0.5f);
            ObjectEffect.DirectionalLight0.Enabled      = true;
            ObjectEffect.DirectionalLight0.DiffuseColor = Vector3.One;
            ObjectEffect.DirectionalLight0.Direction    = Vector3.Normalize(Vector3.One);
            ObjectEffect.LightingEnabled = true;

            ArrayVertexBound = RacingMap.CreateCube();
        }
Ejemplo n.º 2
0
        public Vehicule3D(List <AITunnel> ListAITunnel, List <Object3D> ListCollisionBox, GraphicsDevice g, Vector3 Position)
            : base(g, Matrix.Identity, ListAITunnel, ListCollisionBox)
        {
            TeleportRelative(Position);

            effect = new BasicEffect(g);
            effect.AmbientLightColor              = new Vector3(1, 0, 0);
            effect.DirectionalLight0.Enabled      = true;
            effect.DirectionalLight0.DiffuseColor = Vector3.One;
            effect.DirectionalLight0.Direction    = Vector3.Normalize(Vector3.One);
            effect.LightingEnabled = true;

            float  aspectRatio = g.Viewport.Width / (float)g.Viewport.Height;
            Matrix Projection  = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4,
                                                                     aspectRatio,
                                                                     1, 10000);

            effect.Projection = Projection;

            vertexes = RacingMap.CreateCube();
            ArrayAntiGravPropulsor              = new AntiGravPropulsor[1];
            ArrayAntiGravPropulsor[0]           = CreateAntiGravPropulsor(g, Projection, 1f, Position);
            ArrayAntiGravPropulsor[0].Position += new Vector3(0f, 2f, 0f);
        }