Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OpenGL Lighting Issue
#7
try (row 8, 9)

_glLightfv _GL_LIGHT0, _GL_SPOT_DIRECTION,  _offset(glVec4(0, 1, 0, 0))
_glLightfv _GL_LIGHT0, _GL_SPOT_EXPONENT, _offset (glVec4(1, 0, 0, 0))

I can't see the perspective settings in the program either:
example:


Declare Library
    Sub gluLookAt (ByVal eyeX As Double, Byval eyeY As Double, Byval eyeZ As Double, Byval centerX As Double, Byval centerY As Double, Byval CenterZ As Double, Byval upX As Double, Byval upY As Double, Byval upZ As Double)
End Declare

  ' try first call _glLightfv and as second after all _glenable (part of my program hereSmile

    _glLightfv _GL_LIGHT0, _GL_DIFFUSE, _Offset(Light_Diffuse())
    _glLightfv _GL_LIGHT0, GL_POSITION, _Offset(Light_Position())
    _glEnable _GL_LIGHT0
    _glEnable _GL_LIGHTING
    _glEnable _GL_DEPTH_TEST
    _glMatrixMode _GL_PROJECTION
    _gluPerspective 40.0, 1.0, 1.0, 10.0
    '  glMatrixMode(GL_MODELVIEW);
    _glMatrixMode _GL_MODELVIEW
    '  gluLookAt(0.0, 0.0, 5.0,  /* eye is at (0,0,5) */
    '    0.0, 0.0, 0.0,      /* center is at (0,0,0) */
    '    0.0, 1.0, 0.);      /* up is in positive Y direction */
    gluLookAt 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0

    '  /* Adjust cube position to be asthetic angle. */
    '  glTranslatef(0.0, 0.0, -1.0);
    '  glRotatef(60, 1.0, 0.0, 0.0);
    '  glRotatef(-20, 0.0, 0.0, 1.0);

    _glTranslatef 0.0, 0.0, -1.0
    _glRotatef 60, 1.0, 0.0, 0.0
    _glRotatef -20, 0.0, 0.0, 1.0

maybe this help, maybe not, OpenGL is magic garden...


Reply


Messages In This Thread
OpenGL Lighting Issue - by aadityap0901 - 09-23-2024, 12:47 PM
RE: OpenGL Lighting Issue - by MasterGy - 09-23-2024, 01:22 PM
RE: OpenGL Lighting Issue - by aadityap0901 - 09-23-2024, 02:45 PM
RE: OpenGL Lighting Issue - by MasterGy - 09-23-2024, 02:58 PM
RE: OpenGL Lighting Issue - by MasterGy - 09-23-2024, 03:40 PM
RE: OpenGL Lighting Issue - by aadityap0901 - 09-24-2024, 10:01 AM
RE: OpenGL Lighting Issue - by Petr - 09-24-2024, 07:31 PM
RE: OpenGL Lighting Issue - by aadityap0901 - 09-25-2024, 12:00 PM
RE: OpenGL Lighting Issue - by aadityap0901 - 09-26-2024, 04:05 PM
RE: OpenGL Lighting Issue - by Petr - 09-27-2024, 08:14 AM
RE: OpenGL Lighting Issue - by aadityap0901 - 09-27-2024, 12:31 PM
RE: OpenGL Lighting Issue - by aadityap0901 - 10-02-2024, 12:57 PM



Users browsing this thread: 2 Guest(s)