Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Aug 17, 2019 6:25 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Can you get me oriented?
PostPosted: Wed Dec 09, 2009 10:09 pm 
I want to draw a (grey) sphere with a single light source.
and be able to rotate the light source around the model origin.

I've got the following code so far real newb.
Sub Open() (Of the OpenGLSurface)

//View
OpenGL.glMatrixMode(OpenGL.GL_PROJECTION)
OpenGL.glOrtho(-1.0,1.0,-1.0,1.0,-100.0,100.0)
OpenGL.glMatrixMode(OpenGL.GL_MODELVIEW)
//

//Features
OpenGL.glShadeModel(OpenGL.GL_SMOOTH)
OpenGL.glEnable(OpenGL.GL_LIGHT0)

OpenGL.glDisable(OpenGL.GL_DEPTH_TEST)
//
End Sub
Function Render() As Boolean
//Clear the buffer
OpenGL.glClearColor(0,0,0,1.0)
OpenGL.glClear(OpenGL.gl_COLOR_BUFFER_BIT)

OpenGL.glColor3f (.5, .5, .5)
OpenGl.glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0)

OpenGL.glBegin(OpenGL.GL_POLYGON)
OpenGL.glVertex3f (0.25, 0.25, 0.0)
OpenGL.glVertex3f (0.75, 0.25, 0.0)
OpenGL.glVertex3f (0.75, 0.75, 0.0)
OpenGL.glVertex3f (0.25, 0.75, 0.0)
OpenGL.glEnd()
OpenGL.glFlush()

return something???

End Function


But I'm looking at a white screen...
Probably looking at my feet instead of the object...


Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group