Hi, is this ready for Linux ? I tried loading NBOpenGL-X after but I got
This package depends on the following classes:
� NBXLibConstants
You must resolve these dependencies before you will be able to load these definitions:
� NBGLXContextDriver
� supportsCurrentPlatform
� createContext:
On Feb 22, 2012, at 11:22 PM, Lawson English wrote:
> Thanks for that code, St�phane. I'll work up a video tutorial on it once Igor gets his next configuration* set.
Excellent i was planning to do it but I'm flooded by work
What I want is that every single person with zero knowledge can do it by following the videos.
So if you can do that this is great.
Then I would like to have a 3 min videos showing live modification of openGL objects on the fly.
You write in the browser and boom you see it on the screen.
Here are my notes.
MCHttpRepository
� � location: 'http://www.squeaksource.com/NBOpenGL'
� � user: ''
� � password: ''
ConfigurationOfNBOpenGL project lastVersion load
GLTTRenderingDemo new openInWorld
GLViewportMorph subclass: #GLStef
� � instanceVariableNames: ''
� � classVariableNames: ''
� � poolDictionaries: ''
� � category: 'NBOpenGL-Stef'
GLStef new openInWorld
render
� � | gl |
� � self checkSession.
� � gl := display gl.
� � display clear: Color white.
+ refresh
gluperspective glfrustum
http://nehe.gamedev.net/article/replacement_for_gluperspective/21002/
perspectiveFovY: fovY aspect: aspect zNear: zNear zFar: zFar
"Replaces gluPerspective. Sets the frustum to perspective mode.
// fovY � � - Field of vision in degrees in the y direction
// aspect � - Aspect ratio of the viewport
// zNear � �- The near clipping distance
// zFar � � - The far clipping distance
�"
perspectiveFovY: fovY aspect: aspect zNear: zNear zFar: zFar
"Replaces gluPerspective. Sets the frustum to perspective mode.
// fovY � � - Field of vision in degrees in the y direction
// aspect � - Aspect ratio of the viewport
// zNear � �- The near clipping distance
// zFar � � - The far clipping distance
�"
� � | fW fH |
� � fH := (fovY / (360 * Float pi)) tan * zNear.
� � "fH = tan( fovY / 360 * pi ) * zNear;"
� � fW := fH * aspect.
� � display gl frustum_left: fW negated �right: �fW bottom: fH negated top: fH �zNear: �zNear zFar: � zFar
openGL cube tutorial
http://nehe.gamedev.net/tutorial/3d_shapes/10035/
� � glMatrixMode(GL_PROJECTION); � � � � � � � � � � � � � � �// Select The Projection Matrix
� � glLoadIdentity(); � � � � � � � � � � � � � � � � � � � � � � // Reset The Projection Matrix
� � // Calculate The Aspect Ratio Of The Window
� � gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,100.0f);
� � glMatrixMode(GL_MODELVIEW); � � � � � � � � � � � � � � � � � // Select The Modelview Matrix
� � glLoadIdentity();
render
� � | gl |
� � self checkSession.
� � gl := display gl.
� � display clear: Color white.
� � gl matrixMode: GL_PROJECTION;
� � � � �loadIdentity.
� � self perspectiveFovY: 45.0
� � � � � � � aspect: (self width /self height) asFloat
� � � � � � � zNear: �0.1 zFar: 100.0.
� � gl matrixMode: GL_MODELVIEW.
� � gl loadIdentity.
� � glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); � � // Clear Screen And Depth Buffer
� � glLoadIdentity(); � � � � � � � � � � � � � � � � � � � � � � // Reset The Current Modelview Matrix
� � glTranslatef(-1.5f,0.0f,-6.0f); � � � � � � � � � � � � � � �// Move Left 1.5 Units And Into The Screen 6.0
� � glRotatef(rtri,0.0f,1.0f,0.0f); � � � � � � � � � � � � � � �// Rotate The Triangle On The Y axis ( NEW )
� � glBegin(GL_TRIANGLES); � � � � � � � � � � � � � � � � � � � �// Start Drawing A Triangle
� � � � �glColor3f(1.0f,0.0f,0.0f); � � � � � � � � � � � � � � �// Red
� � � � �glVertex3f( 0.0f, 1.0f, 0.0f); � � � � � � � � � � � � // Top Of Triangle (Front)
� � � � �glColor3f(0.0f,1.0f,0.0f); � � � � � � � � � � � � � � �// Green
� � � � �glVertex3f(-1.0f,-1.0f, 1.0f); � � � � � � � � � � � � // Left Of Triangle (Front)
� � � � �glColor3f(0.0f,0.0f,1.0f); � � � � � � � � � � � � � � �// Blue
� � � � �glVertex3f( 1.0f,-1.0f, 1.0f); � � � � � � � � � � � � // Right Of Triangle (Front)
� � � � �glColor3f(1.0f,0.0f,0.0f); � � � � � � � � � � � � � � �// Red
� � � � �glVertex3f( 0.0f, 1.0f, 0.0f); � � � � � � � � � � � � // Top Of Triangle (Right)
� � � � �glColor3f(0.0f,0.0f,1.0f); � � � � � � � � � � � � � � �// Blue
� � � � �glVertex3f( 1.0f,-1.0f, 1.0f); � � � � � � � � � � � � // Left Of Triangle (Right)
� � � � �glColor3f(0.0f,1.0f,0.0f); � � � � � � � � � � � � � � �// Green
� � � � �glVertex3f( 1.0f,-1.0f, -1.0f); � � � � � � � � � � � � // Right Of Triangle (Right)
� � � � �glColor3f(1.0f,0.0f,0.0f); � � � � � � � � � � � � � � �// Red
� � � � �glVertex3f( 0.0f, 1.0f, 0.0f); � � � � � � � � � � � � // Top Of Triangle (Back)
� � � � �glColor3f(0.0f,1.0f,0.0f); � � � � � � � � � � � � � � �// Green
� � � � �glVertex3f( 1.0f,-1.0f, -1.0f); � � � � � � � � � � � � // Left Of Triangle (Back)
� � � � �glColor3f(0.0f,0.0f,1.0f); � � � � � � � � � � � � � � �// Blue
� � � � �glVertex3f(-1.0f,-1.0f, -1.0f); � � � � � � � � � � � � // Right Of Triangle (Back)
� � � � �glColor3f(1.0f,0.0f,0.0f); � � � � � � � � � � � � � � �// Red
� � � � �glVertex3f( 0.0f, 1.0f, 0.0f); � � � � � � � � � � � � // Top Of Triangle (Left)
� � � � �glColor3f(0.0f,0.0f,1.0f); � � � � � � � � � � � � � � �// Blue
� � � � �glVertex3f(-1.0f,-1.0f,-1.0f); � � � � � � � � � � � � // Left Of Triangle (Left)
� � � � �glColor3f(0.0f,1.0f,0.0f); � � � � � � � � � � � � � � �// Green
� � � � �glVertex3f(-1.0f,-1.0f, 1.0f); � � � � � � � � � � � � // Right Of Triangle (Left)
� � glEnd(); � � � � � � � � � � � � � � � � � � � � � � � � � � � // Done Drawing The Pyramid
� � glLoadIdentity(); � � � � � � � � � � � � � � � � � � � � � � // Reset The Current Modelview Matrix
� � glTranslatef(1.5f,0.0f,-7.0f); � � � � � � � � � � � � � � �// Move Right 1.5 Units And Into The Screen 7.0
� � glRotatef(rquad,1.0f,1.0f,1.0f); � � � � � � � � � � � � // Rotate The Quad On The X axis ( NEW )
� � glBegin(GL_QUADS); � � � � � � � � � � � � � � � � � � � � � � // Draw A Quad
� � � � �glColor3f(0.0f,1.0f,0.0f); � � � � � � � � � � � � � � �// Set The Color To Green
� � � � �glVertex3f( 1.0f, 1.0f,-1.0f); � � � � � � � � � � � � // Top Right Of The Quad (Top)
� � � � �glVertex3f(-1.0f, 1.0f,-1.0f); � � � � � � � � � � � � // Top Left Of The Quad (Top)
� � � � �glVertex3f(-1.0f, 1.0f, 1.0f); � � � � � � � � � � � � // Bottom Left Of The Quad (Top)
� � � � �glVertex3f( 1.0f, 1.0f, 1.0f); � � � � � � � � � � � � // Bottom Right Of The Quad (Top)
� � � � �glColor3f(1.0f,0.5f,0.0f); � � � � � � � � � � � � � � �// Set The Color To Orange
� � � � �glVertex3f( 1.0f,-1.0f, 1.0f); � � � � � � � � � � � � // Top Right Of The Quad (Bottom)
� � � � �glVertex3f(-1.0f,-1.0f, 1.0f); � � � � � � � � � � � � // Top Left Of The Quad (Bottom)
� � � � �glVertex3f(-1.0f,-1.0f,-1.0f); � � � � � � � � � � � � // Bottom Left Of The Quad (Bottom)
� � � � �glVertex3f( 1.0f,-1.0f,-1.0f); � � � � � � � � � � � � // Bottom Right Of The Quad (Bottom)
� � � � �glColor3f(1.0f,0.0f,0.0f); � � � � � � � � � � � � � � �// Set The Color To Red
� � � � �glVertex3f( 1.0f, 1.0f, 1.0f); � � � � � � � � � � � � // Top Right Of The Quad (Front)
� � � � �glVertex3f(-1.0f, 1.0f, 1.0f); � � � � � � � � � � � � // Top Left Of The Quad (Front)
� � � � �glVertex3f(-1.0f,-1.0f, 1.0f); � � � � � � � � � � � � // Bottom Left Of The Quad (Front)
� � � � �glVertex3f( 1.0f,-1.0f, 1.0f); � � � � � � � � � � � � // Bottom Right Of The Quad (Front)
� � � � �glColor3f(1.0f,1.0f,0.0f); � � � � � � � � � � � � � � �// Set The Color To Yellow
� � � � �glVertex3f( 1.0f,-1.0f,-1.0f); � � � � � � � � � � � � // Top Right Of The Quad (Back)
� � � � �glVertex3f(-1.0f,-1.0f,-1.0f); � � � � � � � � � � � � // Top Left Of The Quad (Back)
� � � � �glVertex3f(-1.0f, 1.0f,-1.0f); � � � � � � � � � � � � // Bottom Left Of The Quad (Back)
� � � � �glVertex3f( 1.0f, 1.0f,-1.0f); � � � � � � � � � � � � // Bottom Right Of The Quad (Back)
� � � � �glColor3f(0.0f,0.0f,1.0f); � � � � � � � � � � � � � � �// Set The Color To Blue
� � � � �glVertex3f(-1.0f, 1.0f, 1.0f); � � � � � � � � � � � � // Top Right Of The Quad (Left)
� � � � �glVertex3f(-1.0f, 1.0f,-1.0f); � � � � � � � � � � � � // Top Left Of The Quad (Left)
� � � � �glVertex3f(-1.0f,-1.0f,-1.0f); � � � � � � � � � � � � // Bottom Left Of The Quad (Left)
� � � � �glVertex3f(-1.0f,-1.0f, 1.0f); � � � � � � � � � � � � // Bottom Right Of The Quad (Left)
� � � � �glColor3f(1.0f,0.0f,1.0f); � � � � � � � � � � � � � � �// Set The Color To Violet
� � � � �glVertex3f( 1.0f, 1.0f,-1.0f); � � � � � � � � � � � � // Top Right Of The Quad (Right)
� � � � �glVertex3f( 1.0f, 1.0f, 1.0f); � � � � � � � � � � � � // Top Left Of The Quad (Right)
� � � � �glVertex3f( 1.0f,-1.0f, 1.0f); � � � � � � � � � � � � // Bottom Left Of The Quad (Right)
� � � � �glVertex3f( 1.0f,-1.0f,-1.0f); � � � � � � � � � � � � // Bottom Right Of The Quad (Right)
� � glEnd(); � � � � � � � � � � � � � � � � � � � � � � � � � � � // Done Drawing The Quad
� � rtri+=0.2f; � � � � � � � � � � � � � � � � � � � � � � � � � � � // Increase The Rotation Variable For The Triangle ( NEW )
� � rquad-=0.15f; � � � � � � � � � � � � � � � � � � � � � � � � �// Decrease The Rotation Variable For The Quad ( NEW )
� � return TRUE; � � � � � � � � � � � � � � � � � � � � � � � � �// Keep Going
>
> L.
>
> On 2/22/12 2:11 PM, St�phane Ducasse wrote:
>> Igor coded with me one hour to show me step by step how to produce a rotating pyramid in Pharo :)
>>
>> Have fun (igor will update the configurationOfNBOpenGL to load the latest file).
>>
>>
>>
>
>