From 6e08b92bd4f3e32fdf550f0a3e950e3101a1b06f Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 2 Mar 2008 21:21:13 +0000 Subject: Rotated world --- src/client/draw.cc | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'src/client/draw.cc') diff --git a/src/client/draw.cc b/src/client/draw.cc index 76c55b3..cdf80c2 100644 --- a/src/client/draw.cc +++ b/src/client/draw.cc @@ -45,11 +45,11 @@ void draw_entity_diamond(core::Entity *entity) gl::color(entity->color()); gl::vertex(-r,0.0f,0.0f); - gl::vertex(0.0f,0.0f,r/2); - gl::vertex(0.0f,0.0f,-r/2); + gl::vertex(0.0f,r/2,0.0f); + gl::vertex(0.0f,-r/2,0.0f); - gl::vertex(0.0f,r,0.0f); - gl::vertex(0.0f,-r, 0.0f); + gl::vertex(0.0f,0.0f,r); + gl::vertex(0.0f,0.0f,-r); gl::end(); } @@ -108,7 +108,7 @@ void draw_ship(core::EntityControlable *entity) gl::push(); gl::translate(entity->location()); gl::scale(0.2f, 0.2f, 0.2f); - gl::rotate(entity->direction(), 0.0f, 1.0f, 0.0f ); + gl::rotate(entity->direction(), 0.0f, 0.0f, 1.0f ); Vector3f tl(0.25, 0.125, 0.125); Vector3f br(-0.25, -0.125, -0.125); @@ -151,25 +151,23 @@ void draw_ship(core::EntityControlable *entity) } // shield rotation - gl::rotate(angle, 0.0f, 1.0f, 0.0f ); + gl::rotate(angle, 0.0f, 0.0f, 1.0f ); // draw the shield gl::color(Color(0.0f, 1.0f ,0.0f , 0.5f)); - gl::begin(gl::LineStrip); + gl::begin(gl::LineLoop); gl::vertex(v0); gl::vertex(v1); gl::vertex(v2); gl::vertex(v3); - gl::vertex(v0); gl::end(); - gl::begin(gl::LineStrip); + gl::begin(gl::LineLoop); gl::vertex(v4); gl::vertex(v5); gl::vertex(v6); gl::vertex(v7); - gl::vertex(v4); gl::end(); gl::pop(); @@ -183,28 +181,28 @@ void draw_spacegrid() int gridsize = 32; float s = 1.0f / gridsize; - float y = -4.0f; + float z = -4.0f; float dx = camera::target.x - floorf(camera::target.x); - float dz = camera::target.z - floorf(camera::target.z); + float dy = camera::target.y - floorf(camera::target.y); color(0,0, 1.0f); begin(Lines); for (int i=-gridsize; i <= gridsize; i++) { color(0,0, 0, 0); - vertex(i-dx, y, -gridsize-dz); + vertex(i-dx, -gridsize-dy, z); color(0,0, (gridsize-abs(i))*s, (gridsize-abs(i))*s); - vertex(i-dx, y, -dz); - vertex(i-dx, y, -dz); + vertex(i-dx, -dy, z ); + vertex(i-dx, -dy ,z ); color(0,0, 0, 0); - vertex(i-dx, y, gridsize-dz); + vertex(i-dx, gridsize-dy, z); - vertex(-gridsize-dx, y, i-dz); + vertex(-gridsize-dx, i-dy, z ); color(0,0, (gridsize-abs(i))*s, (gridsize-abs(i))*s); - vertex(-dx, y, i-dz); - vertex(-dx, y, i-dz); + vertex(-dx, i-dy, z); + vertex(-dx, i-dy, z); color(0,0, 0, 0); - vertex(gridsize-dx, y, i-dz); + vertex(gridsize-dx, i-dy, z); } end(); } -- cgit v1.2.3