Exemplo n.º 1
0
 public Satellite(float radio, Planets tipo, Position posicion, string texture)
 {
     this.radio = radio;
     this.tipo = tipo;
     planetaPos = posicion;
     lunaPos = planetaPos;
     lunaPos.x += 3;
     //velocidadOrbita = (float)r.NextDouble() * 0.3f;
     this.texture = texture;
 }
Exemplo n.º 2
0
 public Planet(float radio, Planets tipo, Position posision, string texture,bool hasMoon)
 {
     this.radio = radio;
     this.tipo = tipo;
     p = posision;
     anguloOrbita = r.Next(360);
     velocidadOrbita = (float)r.NextDouble() * 0.3f;
     this.texture = texture;
     if (hasMoon)
     {
         moon = new Satellite(0.5f, Planets.Earth, p, "luna.jpg");
     }
 }
Exemplo n.º 3
0
        public void Paint(Position p,float anguloOrbita)
        {
            Gl.glEnable(Gl.GL_TEXTURE_2D);
            Gl.glBindTexture(Gl.GL_TEXTURE_2D, ContentManager.GetTextureByName(texture));

            anguloOrbita += velocidadOrbita;
            anguloRotacion += 0.6f;
            angulOrbitaPlaneta += 0.6f;
            Gl.glPushMatrix();
            Gl.glRotatef(anguloOrbita, 0, 1, 0);
            Gl.glTranslatef(-p.x, -p.y, -p.z);
            Gl.glRotatef(angulOrbitaPlaneta, 0, 1, 0);
            Gl.glTranslatef(2, 0, 0);
            Gl.glRotatef(anguloRotacion, 0, 1, 0);
            Gl.glCallList(list);
            Gl.glPopMatrix();
            Gl.glDisable(Gl.GL_TEXTURE_2D);
        }