Teapot.cpp

00001 #include "Teapot.h"
00002 
00003 Teapot::Teapot (double s)
00004 {
00005         size = s;
00006 }
00007 
00008 Teapot::~Teapot ()
00009 {
00010         // don't do anything
00011 }
00012 
00013 void Teapot::Draw ()
00014 {
00015         // additional rotation required (to make the positive x-axis the main direction)
00016         glRotatef (90, 1.0f, 0.0f, 0.0f);
00017         
00018         glColor4fv (color),
00019 
00020         glutSolidTeapot (size);
00021 
00022         // undo rotation
00023         glRotatef (270, 1.0f, 0.0f, 0.0f);
00024 }
00025 
00026 double Teapot::GetBoundingRadius ()
00027 {
00028         return size * 2;
00029 }
00030 
00031 BoundingBox Teapot::GetBoundingBox ()
00032 {
00033         BoundingBox result;
00034 
00035         result.xmin = -size * 1.7;
00036         result.xmax = size * 1.7;
00037         result.ymin = -size;
00038         result.ymax = size;
00039         result.zmin = -size * 0.9;
00040         result.zmax = size * 0.9;
00041 
00042         return result;
00043 
00044 
00045 }

Generated on Sun Jul 2 13:20:39 2006 for Demo by  doxygen 1.4.6-NO