Oxygen Basic

Programming => Example Code => Topic started by: Peter on July 01, 2011, 12:05:51 PM

Title: Opengl3D
Post by: Peter on July 01, 2011, 12:05:51 PM
Deleted
[attachment deleted by admin]
Title: Re: Opengl3D
Post by: JRS on July 01, 2011, 06:54:49 PM
Works for me.



[attachment deleted by admin]
Title: Re: Opengl3D
Post by: kryton9 on July 01, 2011, 07:18:02 PM
Both ran fine here Peter. I enjoyed the space ghosts!
Title: Re: Opengl3D
Post by: Charles Pegge on July 01, 2011, 09:51:32 PM
Can I hit them with a Badminton racket? :)

If you want to maintain the correct x y proportions when the screen is resized then monitor the client rectangle set the perspective at the beginning of each frame:

Code: OxygenBasic
  1.   'SET THE VIEWPORT AND PERSPECTIVE
  2.  '
  3.  GetClientRect  hwnd,&cRect
  4.   glViewport 0, 0, crect.right, crect.bottom
  5.   double aspect=crect.right/crect.bottom
  6.   '
  7.  glMatrixMode   GL_PROJECTION
  8.   glLoadIdentity
  9.   gluPerspective 45, aspect, 1.0, 100
  10.   glMatrixMode   GL_MODELVIEW
  11.   glLoadIdentity
  12.   '
  13.  glClear GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT
  14.   glClearColor 0.5, 0, 0, 0
  15.   ...
  16.  

Charles
Title: Re: Opengl3D
Post by: Charles Pegge on July 02, 2011, 04:36:10 AM

I'll give it a try Peter. Do you also know a substitute for gluLookAt ? I would prefer to use only GL functions if possible.

Thanks

Charles