Terrrain fill dome, added terrain to face count

This commit is contained in:
2018-03-31 21:33:03 -05:00
parent 5a4bafce26
commit bc8c78c90b
3 changed files with 10 additions and 1 deletions

View File

@@ -9,5 +9,11 @@ class IMICFPS
super
glEnable(GL_LIGHTING)
end
def update
super
@y_rotation+=0.01
@y_rotation%=360
end
end
end

View File

@@ -100,6 +100,7 @@ class IMICFPS
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)
# glDrawArrays(GL_TRIANGLE_STRIP, 0, @vertices.size/3)
glDrawArrays(GL_TRIANGLES, 0, @vertices.size/3)
$window.number_of_faces+=@vertices.size/3
glDisableClientState(GL_VERTEX_ARRAY)
glDisableClientState(GL_NORMAL_ARRAY)

View File

@@ -27,7 +27,7 @@ class IMICFPS
# Model.new(type: :obj, file_path: "objects/tree.obj", z: -5)
# Model.new(type: :obj, file_path: "objects/tree.obj", x: -2, z: -6)
# Model.new(type: :obj, file_path: "objects/sponza.obj", scale: 1, y: -0.2)
@terrain = Terrain.new(size: 40, height: 0)
@terrain = Terrain.new(size: 170, height: 0)
@player = Player.new(x: 1, y: 0, z: -1)
@camera = Camera.new(x: 0, y: -2, z: 1)
@@ -100,6 +100,8 @@ class IMICFPS
object.update
end
@skydome.update if @skydome.renderable
@camera.update
$window.close if $window.button_down?(Gosu::KbEscape)