diff --git a/Gemfile.lock b/Gemfile.lock index efebdf3..e5b3117 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,13 +2,18 @@ GEM remote: https://rubygems.org/ specs: glu (8.3.0) + glu (8.3.0-x86-mingw32) glut (8.3.0) - gosu (0.13.1) + glut (8.3.0-x86-mingw32) + gosu (0.13.2) + gosu (0.13.2-x86-mingw32) opengl (0.10.0) + opengl (0.10.0-x86-mingw32) wavefront (0.1.2) PLATFORMS ruby + x86-mingw32 DEPENDENCIES glu diff --git a/i-mic-fps.rb b/i-mic-fps.rb index 51738eb..c71aca0 100644 --- a/i-mic-fps.rb +++ b/i-mic-fps.rb @@ -3,7 +3,6 @@ require "glu" require "glut" require "gosu" require "fiddle" -# require "wavefront" require_relative "lib/wavefront/model" require_relative "lib/wavefront/object" diff --git a/lib/wavefront/model.rb b/lib/wavefront/model.rb index 91d5739..8fb2189 100644 --- a/lib/wavefront/model.rb +++ b/lib/wavefront/model.rb @@ -43,7 +43,6 @@ class IMICFPS def render(x,y,z, scale = 1) glTranslatef(x,y,z) - glScalef(scale,scale,scale) @objects.each_with_index do |o, i| glEnable(GL_CULL_FACE) glEnable(GL_COLOR_MATERIAL) @@ -63,8 +62,8 @@ class IMICFPS glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, [material.diffuse.red, material.diffuse.green, material.diffuse.blue, 1.0]) glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, [material.specular.red, material.specular.green, material.specular.blue, 1.0]) glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, [10.0]) - glNormal3f(normal.x, normal.y, normal.z) - glVertex3f(vertex.x, vertex.y, vertex.z) + glNormal3f(normal.x, normal.y, normal.z) # Don't scale normals + glVertex3f(vertex.x*scale, vertex.y*scale, vertex.z*scale) end glEnd glDisable(GL_CULL_FACE) diff --git a/lib/window.rb b/lib/window.rb index 660b60f..ffe3bb3 100644 --- a/lib/window.rb +++ b/lib/window.rb @@ -69,8 +69,8 @@ class IMICFPS gluLookAt(@camera.x,@camera.y,@camera.z, @angle_x,@angle_y,0, 0,1,0) color = [@c1, @c2, @c3] - @model.draw(0, 0, 0, 0.005) - @model2.draw(5, 0, 0, 0.005) + @model.draw(0, 0, 0, 0.0009) + @model2.draw(5, 0, 0, 0.0009) end @@ -98,8 +98,8 @@ class IMICFPS @angle_y = @angle_y.clamp(-360, 360) self.mouse_x, self.mouse_y = Gosu.screen_width/2, Gosu.screen_height/2 - @light_postion = [@camera.x, @camera.y, @camera.z, 1] - # @light_postion = [1.0, 0.249, 4.09, 1] + @light_postion = [@camera.x, @camera.y, @camera.z, 0] + # @light_postion = [0.0, 10, 0, 0] @camera.x-=@speed if $window.button_down?(Gosu::KbRight) @camera.x+=@speed if $window.button_down?(Gosu::KbLeft)