Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/dave/src/skysphere.cc @ 3777

Last change on this file since 3777 was 3705, checked in by dave, 20 years ago

branches/dave: hab den Himmerl schnell Heller gemacht, kam per Zufall auf die Idee

File size: 2.0 KB
Line 
1
2/*
3   orxonox - the future of 3D-vertical-scrollers
4
5   Copyright (C) 2004 orx
6
7   This program is free software; you can redistribute it and/or modify
8   it under the terms of the GNU General Public License as published by
9   the Free Software Foundation; either version 2, or (at your option)
10   any later version.
11
12   ### File Specific:
13   main-programmer: David Gruetter
14   co-programmer: ...
15
16
17    Created by Dave, this file is actually quite similar to player.cc and so is
18    skybox.h similar to player.h
19    With that said, things should be clear:)
20
21
22
23*/
24
25#include "importer/material.h"
26#include "skysphere.h"
27#include "stdincl.h"
28#include "vector.h"
29#include "world_entity.h"
30
31
32using namespace std;
33
34/**
35   \brief Standart Constructor
36   \todo second Constructor with char* input for different skies
37*/
38Skysphere::Skysphere()
39{ 
40    //GLUquadricObj *sphereObj=0;
41    sphereObj=gluNewQuadric();
42    gluQuadricTexture(sphereObj,GL_TRUE);
43    sky = new Material("Sky");
44    sky->setDiffuseMap("../data/pictures/sky-replace.jpg");
45    sky->setIllum(3);
46    //    sky->setAmbient(1,1,1);
47
48}
49
50/**
51   \brief default destructor
52*/
53Skysphere::~Skysphere()
54{
55    delete sky;
56    delete sphereObj;
57
58}
59
60/**
61   \brief updates the position of the Skysphere
62   \param x the x-coordinate of the Center of the Sphere
63   \param y the y-coordinate of the Center of the Sphere
64   \param z the z-coordinate of the Center of the Sphere
65
66   This is normally done in the update-phase of world, so the Skysphere is always centered at the Camera.
67*/
68void Skysphere::updatePosition(float x,float y,float z)
69{
70    this->a=x;
71    this->b=y;
72    this->c=z;
73}
74
75/**
76   \brief draws the Skysphere
77
78   This part is normally precessed in the "Painting Phase".
79*/
80   
81void Skysphere::draw()
82{
83    glEnable(GL_COLOR_MATERIAL);
84    sky->select();
85    glPushMatrix();
86    glTranslatef(this->a,this->b,this->c);
87   
88    glRotatef(-30,1,0,0);
89    glRotatef(95.0f,0.0f,0.0f,1.0f);
90    glRotatef(-250.0f,0.0,1.0f,0.0f);
91   
92    gluSphere(sphereObj,200.0f,20,20);
93    glPopMatrix();
94    glDisable(GL_COLOR_MATERIAL);
95
96
97}
98
99
Note: See TracBrowser for help on using the repository browser.