mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 23:52:35 +00:00
Fixed scaling lighting weirdness
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user