Posted: Tue Feb 03, 2004 6:59 pm
It is just black (I have nVidia GeForce 2).
No, as I don't exactly know what you're trying to achieve. Sorry if I missed something.Well, can you try the camera with th pc where it works, and tell me what I'm doing wrong ?
The movement i can see in the c-example is almost identical to the one in 'your' pb-app.Polo wrote:I'm trying to do a CAMERA.
A camera who WORKS like this stuff in c++ (in fact, I just translated it into pure...)
http://www.ultimategameprogramming.com/ ... amera2.ZIP
black!here is the stuff without the glu camera, tell me if it works on computers where the first exe don't
http://www.gtnsoft.com/Pure3Dwtglu.exe
Code: Select all
#GL_COLOR_BUFFER_BIT = $00004000
#GL_DEPTH_BUFFER_BIT = $00000100
#GL_TRIANGLES = $0004
#GL_FOG = $0B60
#GL_MODELVIEW = $1700
#GL_PROJECTION = $1701
#WindowWidth = 500
#WindowHeight = 400
#WindowFlags = #PB_Window_TitleBar | #PB_Window_MaximizeGadget | #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered
Global floatX.f
Global floatY.f
Global floatZ.f
Global CameraX.f, CameraY.f, CameraZ.f, CamrotX.f, CamrotY.f, CamrotZ.f, CameraSpeed.f, CameraZoom.f, hDC
CamSpeed.f = 0.025
CameraZoom = 0.5
CamrotY = 50
hWnd = OpenWindow(0, 0, 0, #WindowWidth, #WindowHeight, #WindowFlags, "OpenGLCamera")
If hWnd <> 0
piover180.f = (ATan(1)*4)/180
pfd.PIXELFORMATDESCRIPTOR ;OpenGL starten
hDC = GetDC_(hWnd)
pfd\nSize = SizeOf(PIXELFORMATDESCRIPTOR)
pfd\nVersion = 1
pfd\dwFlags = #PFD_SUPPORT_OPENGL | #PFD_DOUBLEBUFFER | #PFD_DRAW_TO_WINDOW
pfd\iLayerType = #PFD_MAIN_PLANE
pfd\iPixelType = #PFD_TYPE_RGBA
pfd\cColorBits = 24
pfd\cDepthBits = 32
pixformat = ChoosePixelFormat_(hDC, pfd)
SetPixelFormat_(hDC, pixformat, pfd)
hrc = wglCreateContext_(hDC)
wglMakeCurrent_(hDC, hrc)
pixformat = ChoosePixelFormat_(hDC, pfd)
SetPixelFormat_(hDC, pixformat, pfd)
hrc = wglCreateContext_(hDC)
wglMakeCurrent_(hDC,hrc)
SwapBuffers_(hDC)
floatX = 0.5
floatY = 0.25
floatZ = -0.5
glu = gluNewQuadric_()
Repeat
glTranslatef_(0, 0, -7.0)
If GetAsyncKeyState_(#VK_UP) <> 0
CameraZ = CameraZ - Sin((CamrotY-90)*piover180)*CamSpeed
CameraX = CameraX - Cos((CamrotY+90)*piover180)*CamSpeed
ElseIf GetAsyncKeyState_(#VK_DOWN) <> 0
CameraZ = CameraZ + Sin((CamrotY-90)*piover180)*CamSpeed
CameraX = CameraX + Cos((CamrotY+90)*piover180)*CamSpeed
EndIf
If GetAsyncKeyState_(#VK_RIGHT) <> 0
CamrotY - (CamSpeed*5)
ElseIf GetAsyncKeyState_(#VK_LEFT) <> 0
CamrotY + (CamSpeed*5)
EndIf
glMatrixMode_(#GL_PROJECTION) ;Höhere Sichtweite, Kamera und Zoom
glLoadIdentity_()
gluPerspective__(45, WindowWidth()/WindowHeight(), 0.0, 20.0)
gluLookAt__(CameraX, CameraY, CameraZ, CameraX - Cos((CamrotY+90)*piover180)*5, 0.0, -CameraZ - Sin((CamrotY-90)*piover180)*5, 0.0, 1.0, 0.0)
; glOrtho__(-2.0+CameraZoom, 2.0-CameraZoom, -2.0+CameraZoom, 2.0-CameraZoom, 0.0, 20.0)
; glRotatef_(-CamrotY, 0.0, 1.0, 0.0)
; glTranslatef_(0, 0, -10.0)
glMatrixMode_(#GL_MODELVIEW)
glClear_(#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT)
glLoadIdentity_()
glRotatef_(45.0, 0, 1.0, 0.0)
glTranslatef_(-CameraX, -CameraY, -CameraZ)
glBegin_(#GL_TRIANGLES)
glNormal3f_(0, 0, 1.0)
glColor4f_(0.0, 0.0, 1.0, 1.0)
glVertex3f_(floatX, floatY, floatZ)
glColor4f_(0.0, 1.0, 0.0, 1.0)
glVertex3f_(-floatX, floatY, floatZ)
glColor4f_(1.0, 1.0, 0.0, 1.0)
glVertex3f_(-floatX, -floatY, floatZ)
glEnd_()
glBegin_(#GL_TRIANGLES)
glNormal3f_(0, 0, 1.0)
glColor4f_(0.0, 0.0, 1.0, 1.0)
glVertex3f_(floatX, floatY, floatZ+0.25)
glColor4f_(0.0, 1.0, 0.0, 1.0)
glVertex3f_(-floatX, floatY, floatZ+0.25)
glColor4f_(1.0, 1.0, 0.0, 1.0)
glVertex3f_(-floatX, -floatY, floatZ+0.25)
glEnd_()
SwapBuffers_(hDC)
Event = WindowEvent()
Delay(1) ;For WinME users
Until Event = #PB_Event_CloseWindow
End
EndIfviewtopic.php?t=9116sblank wrote: Am I missing an include file that provides glu/glut functionality?