Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: pu

Hi!

I would like to propose an update of ruby-opengl for wheezy to remove
documentation without clear license.

Please find below the changelog entry and in attachment the full
debdiff.

-----8<---------------------------------

ruby-opengl (0.60.1+dfsg2-1~wheezy1) stable; urgency=medium

  * Imported Upstream version 0.60.1+dfsg2
  * Repack upstream tarball to remove examples/NeHe as it does not have a
    clear license (Closes: #713820).
  * Do not rely on Rake file to clean.

 -- Cédric Boutillier <bou...@debian.org>  Sun, 26 Jan 2014 15:00:58 +0100

----->8---------------------------------

With kind regards,

Cédric

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing'), (500, 'stable'), (150, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.12-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru ruby-opengl-0.60.1+dfsg1/debian/changelog 
ruby-opengl-0.60.1+dfsg2/debian/changelog
--- ruby-opengl-0.60.1+dfsg1/debian/changelog   2012-06-26 14:14:51.000000000 
+0200
+++ ruby-opengl-0.60.1+dfsg2/debian/changelog   2014-01-26 15:28:43.000000000 
+0100
@@ -1,3 +1,12 @@
+ruby-opengl (0.60.1+dfsg2-1~wheezy1) stable; urgency=medium
+
+  * Imported Upstream version 0.60.1+dfsg2
+  * Repack upstream tarball to remove examples/NeHe as it does not have a
+    clear license (Closes: #713820).
+  * Do not rely on Rake file to clean.
+
+ -- Cédric Boutillier <bou...@debian.org>  Sun, 26 Jan 2014 15:00:58 +0100
+
 ruby-opengl (0.60.1+dfsg1-2) unstable; urgency=low
 
   * Bump build dependency on gem2deb to >= 0.3.0~
diff -Nru ruby-opengl-0.60.1+dfsg1/debian/clean 
ruby-opengl-0.60.1+dfsg2/debian/clean
--- ruby-opengl-0.60.1+dfsg1/debian/clean       1970-01-01 01:00:00.000000000 
+0100
+++ ruby-opengl-0.60.1+dfsg2/debian/clean       2014-01-26 15:28:09.000000000 
+0100
@@ -0,0 +1,4 @@
+ext/*/Rakefile
+ext/*/*.o
+ext/*/*.so
+ext/*/mkrf.log
diff -Nru ruby-opengl-0.60.1+dfsg1/debian/copyright 
ruby-opengl-0.60.1+dfsg2/debian/copyright
--- ruby-opengl-0.60.1+dfsg1/debian/copyright   2012-06-26 14:14:02.000000000 
+0200
+++ ruby-opengl-0.60.1+dfsg2/debian/copyright   2014-01-26 15:55:14.000000000 
+0100
@@ -4,6 +4,7 @@
 Comment: Source has been repacked to respect the DFSG
  the file example/misc/fbo_test.rb has been removed, as it does not allow
  the distribution of modified versions.
+ the files examples/NeHe/* as a proper license could not be found.
 
 Files: *
 Copyright: 2004 Yoshiyuki Kusano <yo...@giganet.net>
diff -Nru ruby-opengl-0.60.1+dfsg1/debian/README.source 
ruby-opengl-0.60.1+dfsg2/debian/README.source
--- ruby-opengl-0.60.1+dfsg1/debian/README.source       2012-06-26 
14:14:02.000000000 +0200
+++ ruby-opengl-0.60.1+dfsg2/debian/README.source       2014-01-26 
15:55:14.000000000 +0100
@@ -4,9 +4,10 @@
 
 - examples/misc/fbo_test.rb has been removed, as distribution of modified
   versions is not allowed.
+- examples/NeHe/* have been removes, as a proper could not be found (#713820)
 
 This operation is done automatically by the script debian/repack.sh, called
 in the get-orig-source: target in debian/rules.
 
-Cédric Boutillier <cedric.boutill...@gmail.com>
-Last update: 2012-04-30
+Cédric Boutillier <bou...@debian.org>
+Last update: 2013-06-30
diff -Nru ruby-opengl-0.60.1+dfsg1/debian/repack.sh 
ruby-opengl-0.60.1+dfsg2/debian/repack.sh
--- ruby-opengl-0.60.1+dfsg1/debian/repack.sh   2012-06-26 14:14:02.000000000 
+0200
+++ ruby-opengl-0.60.1+dfsg2/debian/repack.sh   2014-01-26 15:55:14.000000000 
+0100
@@ -4,7 +4,7 @@
 #
 # In this case the files removed are:
 # - examples/misc/fbo_test.rb
-
+# - examples/NeHe
 
 set -e
 
@@ -21,9 +21,12 @@
 # remove example not allowing distribution if modified
 rm ruby-opengl-$DEB_UPSTREAM_VERSION/examples/misc/fbo_test.rb
 
+# remove NeHe examples, without clear license
+rm -rf ruby-opengl-$DEB_UPSTREAM_VERSION/examples/NeHe
+
 # repack the tarball
 mv ruby-opengl-$DEB_UPSTREAM_VERSION ruby-opengl-$DEB_UPSTREAM_VERSION.orig
 GZIP=--best tar --create --gzip --owner root --group root --mode a+rX \
-       --file ../ruby-opengl_$DEB_UPSTREAM_VERSION+dfsg1.orig.tar.gz 
ruby-opengl-$DEB_UPSTREAM_VERSION.orig
+       --file ../ruby-opengl_$DEB_UPSTREAM_VERSION+dfsg2.orig.tar.gz 
ruby-opengl-$DEB_UPSTREAM_VERSION.orig
 rm -r ruby-opengl-$DEB_UPSTREAM_VERSION.orig
 
diff -Nru ruby-opengl-0.60.1+dfsg1/debian/rules 
ruby-opengl-0.60.1+dfsg2/debian/rules
--- ruby-opengl-0.60.1+dfsg1/debian/rules       2012-06-26 14:14:02.000000000 
+0200
+++ ruby-opengl-0.60.1+dfsg2/debian/rules       2014-01-26 15:28:09.000000000 
+0100
@@ -21,8 +21,5 @@
        dh_installexamples
        find debian/ruby-opengl/usr/share/doc/ruby-opengl/examples/ -name 
"*.rb"  -exec chmod a-x '{}' \;
 
-override_dh_auto_clean:
-       rake clean
-
 get-orig:
        debian/repack.sh
diff -Nru ruby-opengl-0.60.1+dfsg1/examples/NeHe/nehe_lesson02.rb 
ruby-opengl-0.60.1+dfsg2/examples/NeHe/nehe_lesson02.rb
--- ruby-opengl-0.60.1+dfsg1/examples/NeHe/nehe_lesson02.rb     2010-05-25 
19:46:59.000000000 +0200
+++ ruby-opengl-0.60.1+dfsg2/examples/NeHe/nehe_lesson02.rb     1970-01-01 
01:00:00.000000000 +0100
@@ -1,117 +0,0 @@
-#!/usr/bin/env ruby -rubygems
-# Name:  nehe_lesson02.rb
-# Purpose: An implementation of NeHe's OpenGL Lesson #02
-#          using ruby-opengl (http://nehe.gamedev.net/)
-# 
-
-require "gl"
-require "glu"
-require "glut"
-require "mathn"
-
-# Add GL and GLUT namespaces in to make porting easier
-include Gl
-include Glu
-include Glut
-
-# Placeholder for the window object
-window = ""
-
-def init_gl_window(width = 640, height = 480)
-    # Background color to black
-    glClearColor(0.0, 0.0, 0.0, 0)
-    # Enables clearing of depth buffer
-    glClearDepth(1.0)
-    # Set type of depth test
-    glDepthFunc(GL_LEQUAL)
-    # Enable depth testing
-    glEnable(GL_DEPTH_TEST)
-    # Enable smooth color shading
-    glShadeModel(GL_SMOOTH)
-
-    glMatrixMode(GL_PROJECTION)
-    glLoadIdentity
-    # Calculate aspect ratio of the window
-    gluPerspective(45.0, width / height, 0.1, 100.0)
-
-    glMatrixMode(GL_MODELVIEW)
-
-    draw_gl_scene
-end
-
-#reshape = Proc.new do |width, height|
-def reshape(width, height)
-    height = 1 if height == 0
-
-    # Reset current viewpoint and perspective transformation
-    glViewport(0, 0, width, height)
-
-    glMatrixMode(GL_PROJECTION)
-    glLoadIdentity
-
-    gluPerspective(45.0, width / height, 0.1, 100.0)
-end
-
-#draw_gl_scene = Proc.new do
-def draw_gl_scene
-    # Clear the screen and depth buffer
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
-
-    # Reset the view
-    glMatrixMode(GL_MODELVIEW)
-    glLoadIdentity
-
-    # Move left 1.5 units and into the screen 6.0 units
-    glTranslatef(-1.5, 0.0, -6.0)
-
-    # Draw a triangle
-    glBegin(GL_POLYGON)
-        glVertex3f( 0.0,  1.0, 0.0)
-        glVertex3f( 1.0, -1.0, 0.0)
-        glVertex3f(-1.0, -1.0, 0.0)
-    glEnd
-
-    # Move right 3 units
-    glTranslatef(3.0, 0.0, 0.0)
-
-    # Draw a rectangle
-    glBegin(GL_QUADS)
-        glVertex3f(-1.0,  1.0, 0.0)
-        glVertex3f( 1.0,  1.0, 0.0)
-        glVertex3f( 1.0, -1.0, 0.0)
-        glVertex3f(-1.0, -1.0, 0.0)
-    glEnd
-
-    # Swap buffers for display 
-    glutSwapBuffers
-end
-
-# The idle function to handle 
-def idle
-    glutPostRedisplay
-end
-
-# Keyboard handler to exit when ESC is typed
-keyboard = lambda do |key, x, y|
-    case(key)
-      when ?\e
-          glutDestroyWindow(window)
-          exit(0)
-      end
-      glutPostRedisplay
-end
-
-
-# Initliaze our GLUT code
-glutInit;
-# Setup a double buffer, RGBA color, alpha components and depth buffer
-glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
-glutInitWindowSize(640, 480);
-glutInitWindowPosition(0, 0);
-window = glutCreateWindow("NeHe Lesson 02 - ruby-opengl version");
-glutDisplayFunc(method(:draw_gl_scene).to_proc);
-glutReshapeFunc(method(:reshape).to_proc);
-glutIdleFunc(method(:idle).to_proc);
-glutKeyboardFunc(keyboard);
-init_gl_window(640, 480)
-glutMainLoop();
diff -Nru ruby-opengl-0.60.1+dfsg1/examples/NeHe/nehe_lesson03.rb 
ruby-opengl-0.60.1+dfsg2/examples/NeHe/nehe_lesson03.rb
--- ruby-opengl-0.60.1+dfsg1/examples/NeHe/nehe_lesson03.rb     2010-05-25 
19:46:59.000000000 +0200
+++ ruby-opengl-0.60.1+dfsg2/examples/NeHe/nehe_lesson03.rb     1970-01-01 
01:00:00.000000000 +0100
@@ -1,122 +0,0 @@
-#!/usr/bin/env ruby -rubygems
-# Name:  nehe_lesson03.rb
-# Purpose: An implementation of NeHe's OpenGL Lesson #03
-#          using ruby-opengl (http://nehe.gamedev.net/)
-# 
-
-require "gl"
-require "glu"
-require "glut"
-require "mathn"
-
-# Add GL and GLUT namespaces in to make porting easier
-include Gl
-include Glu
-include Glut
-
-# Placeholder for the window object
-window = ""
-
-def init_gl_window(width = 640, height = 480)
-    # Background color to black
-    glClearColor(0.0, 0.0, 0.0, 0)
-    # Enables clearing of depth buffer
-    glClearDepth(1.0)
-    # Set type of depth test
-    glDepthFunc(GL_LEQUAL)
-    # Enable depth testing
-    glEnable(GL_DEPTH_TEST)
-    # Enable smooth color shading
-    glShadeModel(GL_SMOOTH)
-
-    glMatrixMode(GL_PROJECTION)
-    glLoadIdentity
-    # Calculate aspect ratio of the window
-    gluPerspective(45.0, width / height, 0.1, 100.0)
-
-    glMatrixMode(GL_MODELVIEW)
-
-    draw_gl_scene
-end
-
-#reshape = Proc.new do |width, height|
-def reshape(width, height)
-    height = 1 if height == 0
-
-    # Reset current viewpoint and perspective transformation
-    glViewport(0, 0, width, height)
-
-    glMatrixMode(GL_PROJECTION)
-    glLoadIdentity
-
-    gluPerspective(45.0, width / height, 0.1, 100.0)
-end
-
-#draw_gl_scene = Proc.new do
-def draw_gl_scene
-    # Clear the screen and depth buffer
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
-
-    # Reset the view
-    glMatrixMode(GL_MODELVIEW)
-    glLoadIdentity
-
-    # Move left 1.5 units and into the screen 6.0 units
-    glTranslatef(-1.5, 0.0, -6.0)
-
-    # Draw a triangle
-    glBegin(GL_POLYGON)
-        glColor3f(1.0, 0.0, 0.0)
-        glVertex3f( 0.0,  1.0, 0.0)
-        glColor3f(0.0, 1.0, 0.0)
-        glVertex3f( 1.0, -1.0, 0.0)
-        glColor3f(0.0, 0.0, 1.0)
-        glVertex3f(-1.0, -1.0, 0.0)
-    glEnd
-
-    # Move right 3 units
-    glTranslatef(3.0, 0.0, 0.0)
-
-    # Draw a rectangle
-    # Set it to a blue color one time only
-    glColor3f(0.5, 0.5, 1.0)
-    glBegin(GL_QUADS)
-        glVertex3f(-1.0,  1.0, 0.0)
-        glVertex3f( 1.0,  1.0, 0.0)
-        glVertex3f( 1.0, -1.0, 0.0)
-        glVertex3f(-1.0, -1.0, 0.0)
-    glEnd
-
-    # Swap buffers for display 
-    glutSwapBuffers
-end
-
-# The idle function to handle 
-def idle
-    glutPostRedisplay
-end
-
-# Keyboard handler to exit when ESC is typed
-keyboard = lambda do |key, x, y|
-    case(key)
-      when ?\e
-          glutDestroyWindow(window)
-          exit(0)
-      end
-      glutPostRedisplay
-end
-
-
-# Initliaze our GLUT code
-glutInit;
-# Setup a double buffer, RGBA color, alpha components and depth buffer
-glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
-glutInitWindowSize(640, 480);
-glutInitWindowPosition(0, 0);
-window = glutCreateWindow("NeHe Lesson 03 - ruby-opengl version");
-glutDisplayFunc(method(:draw_gl_scene).to_proc);
-glutReshapeFunc(method(:reshape).to_proc);
-glutIdleFunc(method(:idle).to_proc);
-glutKeyboardFunc(keyboard);
-init_gl_window(640, 480)
-glutMainLoop();
diff -Nru ruby-opengl-0.60.1+dfsg1/examples/NeHe/nehe_lesson04.rb 
ruby-opengl-0.60.1+dfsg2/examples/NeHe/nehe_lesson04.rb
--- ruby-opengl-0.60.1+dfsg1/examples/NeHe/nehe_lesson04.rb     2010-05-25 
19:46:59.000000000 +0200
+++ ruby-opengl-0.60.1+dfsg2/examples/NeHe/nehe_lesson04.rb     1970-01-01 
01:00:00.000000000 +0100
@@ -1,133 +0,0 @@
-#!/usr/bin/env ruby -rubygems
-# Name:  nehe_lesson04.rb
-# Purpose: An implementation of NeHe's OpenGL Lesson #04
-#          using ruby-opengl (http://nehe.gamedev.net/)
-# 
-
-require "gl"
-require "glu"
-require "glut"
-require "mathn"
-
-# Add GL and GLUT namespaces in to make porting easier
-include Gl
-include Glu
-include Glut
-
-# Placeholder for the window object
-$window = ""
-# Angle for the triangle  (Global)
-$triangle_angle = 0
-# Angle for the quadrilateral (Global)
-$quad_angle = 0
-
-def init_gl_window(width = 640, height = 480)
-    # Background color to black
-    glClearColor(0.0, 0.0, 0.0, 0)
-    # Enables clearing of depth buffer
-    glClearDepth(1.0)
-    # Set type of depth test
-    glDepthFunc(GL_LEQUAL)
-    # Enable depth testing
-    glEnable(GL_DEPTH_TEST)
-    # Enable smooth color shading
-    glShadeModel(GL_SMOOTH)
-
-    glMatrixMode(GL_PROJECTION)
-    glLoadIdentity
-    # Calculate aspect ratio of the window
-    gluPerspective(45.0, width / height, 0.1, 100.0)
-
-    glMatrixMode(GL_MODELVIEW)
-
-    draw_gl_scene
-end
-
-#reshape = Proc.new do |width, height|
-def reshape(width, height)
-    height = 1 if height == 0
-
-    # Reset current viewpoint and perspective transformation
-    glViewport(0, 0, width, height)
-
-    glMatrixMode(GL_PROJECTION)
-    glLoadIdentity
-
-    gluPerspective(45.0, width / height, 0.1, 100.0)
-end
-
-#draw_gl_scene = Proc.new do
-def draw_gl_scene
-    # Clear the screen and depth buffer
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
-
-    # Reset the view
-    glMatrixMode(GL_MODELVIEW)
-    glLoadIdentity
-
-    # Move left 1.5 units and into the screen 6.0 units
-    glTranslatef(-1.5, 0.0, -6.0)
-
-    # Rotate the triangle on the Y-axis
-    glRotatef($triangle_angle, 0.0, 1.0, 0.0)
-    # Draw a triangle
-    glBegin(GL_POLYGON)
-        glColor3f(1.0, 0.0, 0.0)
-        glVertex3f( 0.0,  1.0, 0.0)
-        glColor3f(0.0, 1.0, 0.0)
-        glVertex3f( 1.0, -1.0, 0.0)
-        glColor3f(0.0, 0.0, 1.0)
-        glVertex3f(-1.0, -1.0, 0.0)
-    glEnd
-
-    # Move right 3 units
-    glLoadIdentity
-    glTranslatef(1.5, 0.0, -6.0)
-
-    # Draw a quadrilateral
-    # Rotate the quad on the X-axis
-    glRotatef($quad_angle, 1.0, 0.0, 0.0)
-    # Set it to a blue color one time only
-    glColor3f(0.5, 0.5, 1.0)
-    glBegin(GL_QUADS)
-        glVertex3f(-1.0,  1.0, 0.0)
-        glVertex3f( 1.0,  1.0, 0.0)
-        glVertex3f( 1.0, -1.0, 0.0)
-        glVertex3f(-1.0, -1.0, 0.0)
-    glEnd
-
-    $triangle_angle += 0.2
-    $quad_angle -= 0.15
-    # Swap buffers for display 
-    glutSwapBuffers
-end
-
-# The idle function to handle 
-def idle
-    glutPostRedisplay
-end
-
-# Keyboard handler to exit when ESC is typed
-keyboard = lambda do |key, x, y|
-    case(key)
-      when ?\e
-          glutDestroyWindow($window)
-          exit(0)
-      end
-      glutPostRedisplay
-end
-
-
-# Initliaze our GLUT code
-glutInit;
-# Setup a double buffer, RGBA color, alpha components and depth buffer
-glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
-glutInitWindowSize(640, 480);
-glutInitWindowPosition(0, 0);
-$window = glutCreateWindow("NeHe Lesson 04 - ruby-opengl version");
-glutDisplayFunc(method(:draw_gl_scene).to_proc);
-glutReshapeFunc(method(:reshape).to_proc);
-glutIdleFunc(method(:idle).to_proc);
-glutKeyboardFunc(keyboard);
-init_gl_window(640, 480)
-glutMainLoop();
diff -Nru ruby-opengl-0.60.1+dfsg1/examples/NeHe/nehe_lesson05.rb 
ruby-opengl-0.60.1+dfsg2/examples/NeHe/nehe_lesson05.rb
--- ruby-opengl-0.60.1+dfsg1/examples/NeHe/nehe_lesson05.rb     2010-05-25 
19:46:59.000000000 +0200
+++ ruby-opengl-0.60.1+dfsg2/examples/NeHe/nehe_lesson05.rb     1970-01-01 
01:00:00.000000000 +0100
@@ -1,186 +0,0 @@
-#!/usr/bin/env ruby -rubygems
-# Name:  nehe_lesson05.rb
-# Purpose: An implementation of NeHe's OpenGL Lesson #05
-#          using ruby-opengl (http://nehe.gamedev.net/)
-# 
-
-require "gl"
-require "glu"
-require "glut"
-require "mathn"
-
-# Add GL and GLUT namespaces in to make porting easier
-include Gl
-include Glu
-include Glut
-
-# Placeholder for the window object
-$window = ""
-# Angle for the triangle  (Global)
-$pyramid_angle = 0
-# Angle for the quadrilateral (Global)
-$cube_angle = 0
-
-def init_gl_window(width = 640, height = 480)
-    # Background color to black
-    glClearColor(0.0, 0.0, 0.0, 0)
-    # Enables clearing of depth buffer
-    glClearDepth(1.0)
-    # Set type of depth test
-    glDepthFunc(GL_LEQUAL)
-    # Enable depth testing
-    glEnable(GL_DEPTH_TEST)
-    # Enable smooth color shading
-    glShadeModel(GL_SMOOTH)
-
-    glMatrixMode(GL_PROJECTION)
-    glLoadIdentity
-    # Calculate aspect ratio of the window
-    gluPerspective(45.0, width / height, 0.1, 100.0)
-
-    glMatrixMode(GL_MODELVIEW)
-
-    draw_gl_scene
-end
-
-#reshape = Proc.new do |width, height|
-def reshape(width, height)
-    height = 1 if height == 0
-
-    # Reset current viewpoint and perspective transformation
-    glViewport(0, 0, width, height)
-
-    glMatrixMode(GL_PROJECTION)
-    glLoadIdentity
-
-    gluPerspective(45.0, width / height, 0.1, 100.0)
-end
-
-#draw_gl_scene = Proc.new do
-def draw_gl_scene
-    # Clear the screen and depth buffer
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
-
-    # Reset the view
-    glMatrixMode(GL_MODELVIEW)
-    glLoadIdentity
-
-    # Move left 1.5 units and into the screen 6.0 units
-    glTranslatef(-1.5, 0.0, -6.0)
-
-    # Rotate the pyramid on the Y-axis
-    glRotatef($pyramid_angle, 0.0, 1.0, 0.0)
-    # Draw a pyramid
-    glBegin(GL_POLYGON)
-        # Draw front side of pyramid
-        glColor3f(1.0, 0.0, 0.0)
-        glVertex3f( 0.0,  1.0, 0.0)
-        glColor3f(0.0, 1.0, 0.0)
-        glVertex3f(-1.0, -1.0, 1.0)
-        glColor3f(0.0, 0.0, 1.0)
-        glVertex3f(1.0, -1.0, 1.0)
-        # Draw right side of pyramid
-        glColor3f(1.0, 0.0, 0.0)
-        glVertex3f( 0.0,  1.0, 0.0)
-        glColor3f(0.0, 0.0, 1.0)
-        glVertex3f( 1.0, -1.0, 1.0)
-        glColor3f(0.0, 1.0, 0.0)
-        glVertex3f(1.0, -1.0, -1.0)
-        # Draw back side of pyramid
-        glColor3f(1.0, 0.0, 0.0)
-        glVertex3f( 0.0,  1.0, 0.0)
-        glColor3f(0.0, 0.0, 1.0)
-        glVertex3f(1.0, -1.0, -1.0)
-        glColor3f(0.0, 1.0, 0.0)
-        glVertex3f(-1.0, -1.0, -1.0)
-        # Draw left side of pyramid
-        glColor3f(1.0, 0.0, 0.0)
-        glVertex3f( 0.0,  1.0, 0.0)
-        glColor3f(0.0, 0.0, 1.0)
-        glVertex3f(-1.0, -1.0, -1.0)
-        glColor3f(0.0, 1.0, 0.0)
-        glVertex3f(-1.0, -1.0, 1.0)
-    glEnd
-
-    glLoadIdentity
-    # Move right 3 units
-    glTranslatef(1.5, 0.0, -7.0)
-
-    # Draw a cube
-    # Rotate the cube on the X, Y and Z axis
-    glRotatef($cube_angle, 1.0, 1.0, 1.0)
-    # Set it to a blue color one time only
-    glBegin(GL_QUADS)
-        # Draw the top side in green
-        glColor3f(0.0, 1.0, 0.0)
-        glVertex3f( 1.0,  1.0, -1.0)
-        glVertex3f(-1.0,  1.0, -1.0)
-        glVertex3f(-1.0,  1.0,  1.0)
-        glVertex3f( 1.0,  1.0,  1.0)
-        # Draw the bottom side in orange
-        glColor3f(1.0, 0.5, 0.0)
-        glVertex3f( 1.0, -1.0,  1.0)
-        glVertex3f(-1.0, -1.0,  1.0)
-        glVertex3f(-1.0, -1.0, -1.0)
-        glVertex3f( 1.0, -1.0, -1.0)
-        # Draw the front side in red
-        glColor3f(1.0, 0.0, 0.0)
-        glVertex3f( 1.0,  1.0,  1.0)
-        glVertex3f(-1.0,  1.0,  1.0)
-        glVertex3f(-1.0, -1.0,  1.0)
-        glVertex3f( 1.0, -1.0,  1.0)
-        # Draw the back side in yellow
-        glColor3f(1.0, 1.0, 0.0)
-        glVertex3f( 1.0, -1.0, -1.0)
-        glVertex3f(-1.0, -1.0, -1.0)
-        glVertex3f(-1.0,  1.0, -1.0)
-        glVertex3f( 1.0,  1.0, -1.0)
-        # Draw the left side in blue
-        glColor3f(0.0, 0.0, 1.0)
-        glVertex3f(-1.0,  1.0,  1.0)
-        glVertex3f(-1.0,  1.0, -1.0)
-        glVertex3f(-1.0, -1.0, -1.0)
-        glVertex3f(-1.0, -1.0,  1.0)
-        # Draw the right side in violet
-        glColor3f(1.0, 0.0, 1.0)
-        glVertex3f( 1.0,  1.0, -1.0)
-        glVertex3f( 1.0,  1.0,  1.0)
-        glVertex3f( 1.0, -1.0,  1.0)
-        glVertex3f( 1.0, -1.0, -1.0)
-    glEnd
-
-    $pyramid_angle += 0.2
-    $cube_angle -= 0.15
-    # Swap buffers for display 
-    glutSwapBuffers
-end
-
-# The idle function to handle 
-def idle
-    glutPostRedisplay
-end
-
-# Keyboard handler to exit when ESC is typed
-keyboard = lambda do |key, x, y|
-    case(key)
-      when ?\e
-          glutDestroyWindow($window)
-          exit(0)
-      end
-      glutPostRedisplay
-end
-
-
-# Initliaze our GLUT code
-glutInit;
-# Setup a double buffer, RGBA color, alpha components and depth buffer
-glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
-glutInitWindowSize(640, 480);
-glutInitWindowPosition(0, 0);
-$window = glutCreateWindow("NeHe Lesson 05 - ruby-opengl version");
-glutDisplayFunc(method(:draw_gl_scene).to_proc);
-glutReshapeFunc(method(:reshape).to_proc);
-glutIdleFunc(method(:idle).to_proc);
-glutKeyboardFunc(keyboard);
-init_gl_window(640, 480)
-glutMainLoop();
diff -Nru ruby-opengl-0.60.1+dfsg1/examples/NeHe/nehe_lesson36.rb 
ruby-opengl-0.60.1+dfsg2/examples/NeHe/nehe_lesson36.rb
--- ruby-opengl-0.60.1+dfsg1/examples/NeHe/nehe_lesson36.rb     2010-05-25 
19:46:59.000000000 +0200
+++ ruby-opengl-0.60.1+dfsg2/examples/NeHe/nehe_lesson36.rb     1970-01-01 
01:00:00.000000000 +0100
@@ -1,303 +0,0 @@
-# Nehe Lesson 36 Code
-# modified from immediate mode to use vertex arrays for helix drawing
-require 'opengl'
-include Gl,Glu,Glut
-include Math
-
-def emptyTexture
-       # Create Storage Space For Texture Data (128x128x4)
-       data = ([0]*4*128*128).pack("f*")
-       txtnumber = glGenTextures(1) # Create 1 Texture
-       glBindTexture(GL_TEXTURE_2D, txtnumber[0]) # Bind The Texture 
-       glTexImage2D(GL_TEXTURE_2D, 0, 4, 128, 128, 0,
-               GL_RGBA, GL_FLOAT, data) # Build Texture Using Information In 
data
-       glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR)
-       glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR)
-       return txtnumber[0] # Return The Texture ID
-end
-
-def init
-       global_ambient = [0.2, 0.2, 0.2, 1.0] # Set Ambient Lighting To Fairly 
Dark Light (No Color)
-       light0pos = [0.0, 5.0, 10.0, 1.0] # Set The Light Position
-       light0ambient = [0.2, 0.2, 0.2, 1.0] # More Ambient Light
-       light0diffuse = [0.3, 0.3, 0.3, 1.0] # Set The Diffuse Light A Bit 
Brighter
-       light0specular = [0.8, 0.8, 0.8, 1.0] # Fairly Bright Specular Lighting
-
-       lmodel_ambient = [0.2,0.2,0.2,1.0] # And More Ambient Light
-
-       $angle = 0.0 # Set Starting Angle To Zero 
-       
-       $lasttime = 0
-       
-       $blurTexture = emptyTexture() # Create Our Empty Texture
-
-       $helix_v,$helix_n = createHelix()
-       glVertexPointer(3,GL_FLOAT,0,$helix_v.flatten.pack("f*"))
-       glNormalPointer(GL_FLOAT,0,$helix_n.flatten.pack("f*"))
-
-       glLoadIdentity() # Reset The Modelview Matrix
-
-       glEnable(GL_DEPTH_TEST) # Enable Depth Testing
-
-       glLightModelfv(GL_LIGHT_MODEL_AMBIENT,lmodel_ambient) # Set The Ambient 
Light Model
-       
-       glLightModelfv(GL_LIGHT_MODEL_AMBIENT,global_ambient) # Set The Global 
Ambient Light Model
-       glLightfv(GL_LIGHT0, GL_POSITION, light0pos) # Set The Lights Position
-       glLightfv(GL_LIGHT0, GL_AMBIENT, light0ambient) # Set The Ambient Light
-       glLightfv(GL_LIGHT0, GL_DIFFUSE, light0diffuse) # Set The Diffuse Light
-       glLightfv(GL_LIGHT0, GL_SPECULAR, light0specular)       # Set Up 
Specular Lighting
-       glEnable(GL_LIGHTING) # Enable Lighting
-       glEnable(GL_LIGHT0) # Enable Light0
-
-       glShadeModel(GL_SMOOTH) # Select Smooth Shading
-
-       glMateriali(GL_FRONT, GL_SHININESS, 128)
-       glClearColor(0.0, 0.0, 0.0, 0.5) # Set The Clear Color To Black
-end
-
-# Keyboard handler to exit when ESC is typed
-keyboard = lambda do |key, x, y|
-       case(key)
-               when ?\e
-                       exit(0)
-       end
-       glutPostRedisplay
-end
-
-reshape = lambda do |w,h|
-       glMatrixMode(GL_PROJECTION)
-       glViewport(0,0,w,h)
-       glLoadIdentity()
-       width = 0.5
-       height = 0.5 * h/w;
-       glFrustum(-width,width,-height,height,1.0,2000.0)
-       glMatrixMode(GL_MODELVIEW)
-       glViewport(0,0,w,h)
-end
-
-def viewOrtho
-       glMatrixMode(GL_PROJECTION) # Select Projection
-       glPushMatrix() # Push The Matrix
-       glLoadIdentity() # Reset The Matrix
-       width = glutGet(GLUT_WINDOW_WIDTH)
-       height = glutGet(GLUT_WINDOW_HEIGHT)
-       glOrtho( 0, width , height , 0, -1, 1 ) # Select Ortho Mode 
(widthxheight)
-       glMatrixMode(GL_MODELVIEW) # Select Modelview Matrix
-       glPushMatrix() # Push The Matrix
-       glLoadIdentity() # Reset The Matrix
-end
-
-def viewPerspective # Set Up A Perspective View
-       glMatrixMode( GL_PROJECTION ) # Select Projection
-       glPopMatrix() # Pop The Matrix
-       glMatrixMode( GL_MODELVIEW ) # Select Modelview
-       glPopMatrix() # Pop The Matrix
-end
-
-def normalize(v)
-       len = sqrt( v[0]*v[0] + v[1]*v[1] + v[2]*v[2])
-       return v if len==0
-       [ v[0] / len, v[1] / len, v[2] / len ]
-end
-
-def calcNormal(v) # Calculates Normal For A Quad Using 3 Points
-       # Finds The Vector Between 2 Points By Subtracting
-       # The x,y,z Coordinates From One Point To Another.
-       # Calculate The Vector From Point 1 To Point 0
-       v1, v2, out = [], [], []
-       x,y,z = 0,1,2
-       
-       v1[x] = v[0][x] - v[1][x] # Vector 1.x=Vertex[0].x-Vertex[1].x 
-       v1[y] = v[0][y] - v[1][y] # Vector 1.y=Vertex[0].y-Vertex[1].y 
-       v1[z] = v[0][z] - v[1][z]       # Vector 1.z=Vertex[0].y-Vertex[1].z 
-       # Calculate The Vector From Point 2 To Point 1 
-       v2[x] = v[1][x] - v[2][x]       # Vector 2.x=Vertex[0].x-Vertex[1].x 
-       v2[y] = v[1][y] - v[2][y]       # Vector 2.y=Vertex[0].y-Vertex[1].y 
-       v2[z] = v[1][z] - v[2][z]       # Vector 2.z=Vertex[0].z-Vertex[1].z 
-       # Compute The Cross Product To Give Us A Surface Normal 
-       out[x] = v1[y]*v2[z] - v1[z]*v2[y] # Cross Product For Y - Z 
-       out[y] = v1[z]*v2[x] - v1[x]*v2[z] # Cross Product For X - Z 
-       out[z] = v1[x]*v2[y] - v1[y]*v2[x] # Cross Product For X - Y 
-
-       normalize(out)
-end
-
-def createHelix() # creates helix VA
-       twists = 5
-       r = 1.5
-
-       helix_v = []
-       helix_n = []
-       
-       0.step(360,20) do |phi| # 360 Degrees In Steps Of 20
-               0.step(360*twists,20) do |theta| # 360 Degrees * Number Of 
Twists In Steps Of 20
-                       v= phi/180.0*PI # Calculate Angle Of First Point        
(  0 ) 
-                       u= theta/180.0*PI # Calculate Angle Of First Point      
(  0 ) 
-
-                       x= cos(u)*(2.0+cos(v))*r # Calculate x Position (1st 
Point) 
-                       y= sin(u)*(2.0+cos(v))*r        # Calculate y Position 
(1st Point) 
-                       z=((u-(2.0*PI)) + sin(v))*r     # Calculate z Position 
(1st Point) 
-
-                       v0 = [x,y,z]
-
-                       v= phi/180.0*PI # Calculate Angle Of Second Point       
(  0 ) 
-                       u= (theta+20)/180.0*PI  # Calculate Angle Of Second 
Point       ( 20 ) 
-
-                       x= cos(u)*(2.0+cos(v))*r # Calculate x Position (2nd 
Point)
-                       y= sin(u)*(2.0+cos(v))*r        # Calculate y Position 
(2nd Point) 
-                       z= ((u-(2.0*PI)) + sin(v))*r    # Calculate z Position 
(2nd Point) 
-               
-                       v1 = [x,y,z]
-
-                       v= (phi+20)/180.0*PI # Calculate Angle Of Third Point   
( 20 ) 
-                       u= (theta+20)/180.0*PI # Calculate Angle Of Third Point 
( 20 ) 
-
-                       x= cos(u)*(2.0+cos(v))*r # Calculate x Position (3rd 
Point) 
-                       y= sin(u)*(2.0+cos(v))*r # Calculate y Position (3rd 
Point) 
-                       z= ((u-(2.0*PI)) + sin(v))*r    # Calculate z Position 
(3rd Point) 
-
-                       v2 = [x,y,z]
-
-                       v= (phi+20)/180.0*PI # Calculate Angle Of Fourth Point  
( 20 ) 
-                       u= (theta)/180.0*PI # Calculate Angle Of Fourth Point   
(  0 ) 
-
-                       x= cos(u)*(2.0+cos(v))*r # Calculate x Position (4th 
Point) 
-                       y= sin(u)*(2.0+cos(v))*r # Calculate y Position (4th 
Point) 
-                       z= ((u-(2.0*PI)) + sin(v))*r # Calculate z Position 
(4th Point) 
-       
-                       v3 = [x,y,z]
-
-                       normal = calcNormal([v0,v1,v2,v3]) # Calculate The Quad 
Normal 
-                       helix_v << v0 << v1 << v2 << v3
-                       helix_n << normal << normal << normal << normal
-               end
-       end
-       [helix_v,helix_n]
-end
-
-def processHelix() # Draws A Helix 
-       glfMaterialColor = [0.4,0.2,0.8,1.0] # Set The Material Color
-       specular = [1.0,1.0,1.0,1.0] # Sets Up Specular Lighting
-
-       glLoadIdentity() # Reset The Modelview Matrix
-       gluLookAt(0, 5, 50, 0, 0, 0, 0, 1, 0) # Eye Position (0,5,50) Center Of 
Scene (0,0,0), Up On Y Axis
-
-       glPushMatrix() # Push The Modelview Matrix
-
-       glTranslatef(0,0,-50) # Translate 50 Units Into The Screen
-       glRotatef($angle/2.0,1,0,0) # Rotate By angle/2 On The X-Axis
-       glRotatef($angle/3.0,0,1,0) # Rotate By angle/3 On The Y-Axis
-
-       glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE,glfMaterialColor)
-       glMaterialfv(GL_FRONT_AND_BACK,GL_SPECULAR,specular)
-
-       glEnableClientState(GL_VERTEX_ARRAY)
-       glEnableClientState(GL_NORMAL_ARRAY)
-       glDrawArrays(GL_QUADS,0,$helix_v.size)
-       glDisableClientState(GL_VERTEX_ARRAY)
-       glDisableClientState(GL_NORMAL_ARRAY)
-
-       glPopMatrix() # Pop The Matrix
-end
-
-def drawBlur(times,inc)
-       spost = 0.0 # Starting Texture Coordinate Offset 
-       alphainc = 0.9 / times # Fade Speed For Alpha Blending 
-       alpha = 0.2     # Starting Alpha Value 
-
-       width = glutGet(GLUT_WINDOW_WIDTH)
-       height = glutGet(GLUT_WINDOW_HEIGHT)
-       # Disable AutoTexture Coordinates 
-       glDisable(GL_TEXTURE_GEN_S)
-       glDisable(GL_TEXTURE_GEN_T)
-
-       glEnable(GL_TEXTURE_2D) # Enable 2D Texture Mapping 
-       glDisable(GL_DEPTH_TEST) # Disable Depth Testing 
-       glBlendFunc(GL_SRC_ALPHA,GL_ONE) # Set Blending Mode 
-       glEnable(GL_BLEND) # Enable Blending 
-       glBindTexture(GL_TEXTURE_2D,$blurTexture) # Bind To The Blur Texture 
-       viewOrtho() # Switch To An Ortho View 
-
-       alphainc = alpha / times # alphainc=0.2 / Times To Render Blur 
-
-       glBegin(GL_QUADS) # Begin Drawing Quads 
-       0.upto(times-1) do |num| # Number Of Times To Render Blur 
-               glColor4f(1.0, 1.0, 1.0, alpha) # Set The Alpha Value (Starts 
At 0.2) 
-               glTexCoord2f(0+spost,1-spost)   # Texture Coordinate    ( 0, 1 
) 
-               glVertex2f(0,0) # First Vertex          (   0,   0 ) 
-
-               glTexCoord2f(0+spost,0+spost) # Texture Coordinate      ( 0, 0 
) 
-               glVertex2f(0,height) # Second Vertex    (   0, height ) 
-
-               glTexCoord2f(1-spost,0+spost) # Texture Coordinate      ( 1, 0 
) 
-               glVertex2f(width,height) # Third Vertex         ( width, height 
) 
-
-               glTexCoord2f(1-spost,1-spost) # Texture Coordinate      ( 1, 1 
) 
-               glVertex2f(width,0) # Fourth Vertex     ( width,   0 ) 
-
-               spost += inc # Gradually Increase spost (Zooming Closer To 
Texture Center) 
-               alpha = alpha - alphainc # Gradually Decrease alpha (Gradually 
Fading Image Out) 
-       end
-       glEnd() # Done Drawing Quads 
-
-       viewPerspective() # Switch To A Perspective View 
-
-       glEnable(GL_DEPTH_TEST) # Enable Depth Testing 
-       glDisable(GL_TEXTURE_2D) # Disable 2D Texture Mapping 
-       glDisable(GL_BLEND) # Disable Blending 
-       glBindTexture(GL_TEXTURE_2D,0) # Unbind The Blur Texture 
-end
-
-
-def renderToTexture
-       glViewport(0,0,128,128); # Set Our Viewport (Match Texture Size)
-
-       processHelix() # Render The Helix
-
-       glBindTexture(GL_TEXTURE_2D,$blurTexture) # Bind To The Blur Texture
-
-       # Copy Our ViewPort To The Blur Texture (From 0,0 To 128,128... No 
Border)
-       glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 0, 0, 128, 128, 0)
-
-       glClearColor(0.0, 0.0, 0.5, 0.5) # Set The Clear Color To Medium Blue
-       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) # Clear The Screen 
And Depth Buffer
-       width = glutGet(GLUT_WINDOW_WIDTH)
-       height = glutGet(GLUT_WINDOW_HEIGHT)
-       glViewport(0 , 0,width,height) # Set Viewport (0,0 to widthxheight)
-end
-
-drawGLScene = lambda do # Draw The Scene
-       glClearColor(0.0, 0.0, 0.0, 0.5) # Set The Clear Color To Black
-       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) # Clear Screen And 
Depth Buffer
-       glLoadIdentity() # Reset The View
-       renderToTexture() # Render To A Texture
-       processHelix() # Draw Our Helix
-       drawBlur(25,0.02) # Draw The Blur Effect 
-       glFlush() # Flush The GL Rendering Pipeline
-       glutSwapBuffers()
-       sleep(0.001) # don't hog all cpu time
-end
-
-idle = lambda do
-       now = glutGet(GLUT_ELAPSED_TIME)
-       elapsed = now - $lasttime
-       $angle += (elapsed * 0.03) # Update angle Based On The Clock 
-       $lasttime = now
-
-       glutPostRedisplay()
-end
-
-# Main
-glutInit()
-glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH)
-glutInitWindowPosition(100,100)
-glutInitWindowSize(640,480)
-glutCreateWindow("NeHe's Lesson 36")
-glutDisplayFunc(drawGLScene)
-glutIdleFunc(idle)
-glutReshapeFunc(reshape)
-glutKeyboardFunc(keyboard)
-
-init()
-
-glutMainLoop()

Attachment: signature.asc
Description: Digital signature

Reply via email to