Closed applesnake closed 7 years ago
Where is your modified 'glwidget.rb'? Show it first, please. Anyway, if you are using glLightfv like:
pos = [0, 0, 0, 1]
# ...
GL.Lightfv(GL::LIGHT0, GL::POSITION, pos) # old/other OpenGL binding style.
you must modify these lines into:
pos = [0, 0, 0, 1].pack('F4')
# ...
glLightfv(GL_LIGHT0, GL_POSITION, pos)
The API style of this gem is not compatible with that of other/old ruby OpenGL bindings. See glut_minimum.rb ( https://github.com/vaiorabbit/ruby-opengl/blob/master/sample/GLUT/glut_minimal.rb ) for example.
A confusing error occurs on run qtbindings(qt4) example 'grabber'. PS: Example code modified. But everything goes well without qtbindings. May it be a bug from fiddle?
Log: /usr/local/lib/ruby/gems/2.4.0/gems/opengl-bindings-1.6.2/lib/opengl_command.rb:1450:in'
[]': can't convert Array into Integer (TypeError) from /usr/local/lib/ruby/gems/2.4.0/gems/opengl-bindings-1.6.2/lib/opengl_command.rb:1450:in
call' from /usr/local/lib/ruby/gems/2.4.0/gems/opengl-bindings-1.6.2/lib/opengl_command.rb:1450:inglLightfv' from /Volumes/Workspace/project/qtruby/examples/opengl/grabber/glwidget.rb:102:in
initializeGL' from /Volumes/Workspace/project/qtruby/examples/opengl/grabber/glwidget.rb:74:inmethod_missing' from /Volumes/Workspace/project/qtruby/examples/opengl/grabber/glwidget.rb:74:in
setXRotation' from /Volumes/Workspace/project/qtruby/examples/opengl/grabber/mainwindow.rb:76:inqt_metacall' from /Volumes/Workspace/project/qtruby/examples/opengl/grabber/mainwindow.rb:76:in
method_missing' from /Volumes/Workspace/project/qtruby/examples/opengl/grabber/mainwindow.rb:76:ininitialize' from main.rb:30:in
new' from main.rb:30:in `