Author Topic: Opengl3D  (Read 2504 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Opengl3D
« on: July 01, 2011, 12:05:51 PM »
Deleted
[attachment deleted by admin]
« Last Edit: April 11, 2015, 09:44:51 AM by Peter »

JRS

  • Guest
Re: Opengl3D
« Reply #1 on: July 01, 2011, 06:54:49 PM »
Works for me.



[attachment deleted by admin]

kryton9

  • Guest
Re: Opengl3D
« Reply #2 on: July 01, 2011, 07:18:02 PM »
Both ran fine here Peter. I enjoyed the space ghosts!

Charles Pegge

  • Guest
Re: Opengl3D
« Reply #3 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
« Last Edit: July 01, 2011, 09:53:55 PM by Charles Pegge »

Charles Pegge

  • Guest
Re: Opengl3D
« Reply #4 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