[Question] Is it possible to set the face.normal?
-
So far I managed to run the example above. Give me some time
-
I don't really know, but OpenGL must have hooks, or act as a server because of the existence of software such as 3D Printscreenwhich is able to capture the 3d Sketchup model and export it to some 3dxml format.
So if the OpenGL data can be "hooked" into, then does the possibility exist to use more OpenGL features not native to SU?
http://forums.sketchucation.com/viewtopic.php?f=10&t=11943&p=84502&hilit=+shaders#p84502
-
Isn't that what Adam B does with LightUp? Hook into the SU's OpenGL? All though, from C and not from Ruby.
-
These are the libraries included in Ruby Windows installer:
http://ruby-opengl.rubyforge.org/. -
But I'd still like to understand if you are getting this to interact with SketchUP somehow? Can you change what and how SU renders with this?
Chris
-
Is this Windows and OSX compatible?
-
Yes you can!
I've just found the first thing that changed the view of the model.
I typed in the Ruby consoleglDisable(GL_DEPTH_TEST)
.
To see result try turning the model around.
Bear in mind that I'm just starting to learn OpenGL .ps. You need to run SU with the files from the zip above in Plugins, except the example.
-
SU keep asking for glut32.dll. It's not in the zip you provided?
-
@pixero said:
SU keep asking for glut32.dll. It's not in the zip you provided?
It didn't ask me. Maybe because I have it in my Ruby installation.
-
I suppose so, try it on Mac.
Below is not however, only Windows. This seems to freeze SketchUp OpenGL.
FindWindow = Win32API.new("user32.dll", "FindWindow", ['P','P'], 'N') GetDC = Win32API.new("user32.dll", "GetDC", ['N'], 'N') GetCurrentContext = Win32API.new("opengl32.dll", "wglGetCurrentContext", ['V'], 'N') CreateContext = Win32API.new("opengl32.dll", "wglCreateContext", ['N'], 'N') MakeCurrent = Win32API.new("opengl32.dll", "wglMakeCurrent", ['N','N'], 'V') DeleteContext = Win32API.new("opengl32.dll", "wglDeleteContext", ['N'], 'V') hwnd = FindWindow.call(0, "Untitled - SketchUp") hdc = GetDC.call(hwnd) hglrc = GetCurrentContext.call() DeleteContext.call(hglrc)
I wonder if this is good direction?
-
So where can I get a Ruby install that has it?
-
One-click windows installer has it. Here: http://rubyinstaller.org/
-
Anyone getting more than one line to work?
-
I only got to change some OpenGL Server variables like GL_COLOR_MATERIAL or GL_DEPTH_TEST.
I don't know the way to hack into drawing context. I wonder how it is done in LightUp (supposing it is done similar way), maybe a window is layered on top of native SketchUp viewport. -
I don't think Lightup does this. I think it renders materials and bakes them into faces in SU. At least that is my (severely limited and naive) understanding.
Advertisement