Loading ...
Sorry, an error occurred while loading the content.

Re: Open GL question

Expand Messages
  • Robert McAllister
    With the way the main lesson program is structured you need to run the examples as they are. There is a quirk with LB where Globals need to be placed at the
    Message 1 of 6 , Aug 3, 2009
    • 0 Attachment
      With the way the main lesson program is structured you need to run the examples as they are. There is a quirk with LB where Globals need to be placed at the beginning of the code to work properly. This is why some the lesson snippets have values declared inside of the subs, instead of using Globals.

      http://libertybasic.conforums.com/index.cgi?board=bugs&action=display&num=1199160979


      Of course, knowing about this issue, you can move the subs to the end of the program as needed and change the way values are supplied to them:)


      Rob



      --- In libertybasic@yahoogroups.com, "Stefan Pendl" <pendl2megabit@...> wrote:
      >
      > >
      > > Pretty simple and all is well until lesson 6. Lesson 6 uses
      > > a subroutine to create a list file that builds a cube that
      > > you rotate. All I get is a bunch of dots moving around on
      > > the screen. The second half of lesson 6 gives me 2 ovals
      > > made out of dots that rotate around. It is like the list
      > > file has the vertexes for the shapes but somehow the solids
      > > are lost. I have corners but no sides, so to speak.
      > >
      >
      > You replace:
      >
      > >>
      > ' dot
      > CALL ClearView eyeX , eyeY , eyeZ , centerX , centerY , centerZ , upX , upY , upZ
      > CALL glColor4fv 1 , 0 , 0 , 1
      > CALL glPointSize 3
      > CALL glBegin GL.POINTS
      > CALL glVertex 0 , 0 , 0
      > CALL glEnd
      > CALL RefreshView
      > WAIT
      > <<
      >
      > with the lesson code up to and including the WAIT command.
      >
      > Additional procedures, like subs and functions go after:
      >
      > >>
      > [quit]
      > CALLDLL #sdl , "SDL_Quit" ,_
      > ret AS long
      > CLOSE #glu
      > CLOSE #gl
      > CLOSE #sdl
      > CLOSE #oleaut32
      > CLOSE #main
      > END
      > <<
      >
      > I have run all the examples by now and all have been working for me.
      >
      > ---
      > Stefan Pendl
      >
      > Liberty BASIC Assist 4.03 ........ http://www.libertybasic.com/assist.html
      > Liberty BASIC 4.04 public beta ... http://www.libertybasic.com/lb404b3setup.exe
      >
      > Windows Vista Home Premium 32-bit SP2
      > AMD Turion X2 RM-70 2GHz, 4GB RAM
      >
    • productdevelop
      I think I am doing it right. I pasted the code and a screen cap of what happens in my folder called productdevelop. I can delete these after you look at
      Message 2 of 6 , Aug 3, 2009
      • 0 Attachment
        I think I am doing it right. I pasted the code and a screen cap of what happens in my folder called productdevelop. I can delete these after you look at them.

        Thanks!
      • Robert McAllister
        My apologies, it seems I posted the wrong version of the samples in lesson 6. They are missing the line GL.QUADS=7 in the subs. I ve updated the samples with
        Message 3 of 6 , Aug 3, 2009
        • 0 Attachment
          My apologies, it seems I posted the wrong version of the samples in lesson 6. They are missing the line "GL.QUADS=7" in the subs. I've updated the samples with the corrected code.

          The reason I believe they worked for Stephan it that he places the subs at the end of the program, thus avoiding the problem with the globals that I mentioned in my previous post. Because of this global problem GL.QUADS=0 (which indicates a point) when the sub is physically located above the global statements.

          Sorry for the confusion and I'm glad you are working through the lessons.

          Rob





          > I think I am doing it right. I pasted the code and a screen cap of what happens in my folder called productdevelop. I can delete these after you look at them.
          >
          > Thanks!
          >
        • productdevelop
          ... Thanks for the help. It works great now. I will work on lesson 6 some more tomorrow. I am going through these exercises to understand what openGL can do
          Message 4 of 6 , Aug 4, 2009
          • 0 Attachment
            --- In libertybasic@yahoogroups.com, "Robert McAllister" <rob@...> wrote:
            >
            > My apologies, it seems I posted the wrong version of the samples in lesson 6. They are missing the line "GL.QUADS=7" in the subs. I've updated the samples with the corrected code.
            >
            > The reason I believe they worked for Stephan it that he places the subs at the end of the program, thus avoiding the problem with the globals that I mentioned in my previous post. Because of this global problem GL.QUADS=0 (which indicates a point) when the sub is physically located above the global statements.
            >
            > Sorry for the confusion and I'm glad you are working through the lessons.
            >
            > Rob

            Thanks for the help. It works great now. I will work on lesson 6 some more tomorrow. I am going through these exercises to understand what openGL can do for me. I do understand that I will need to dig in further to understand all of the globals and their roles in making the specific outputs that I see.

            These lessons are very helpful and I appreciate the time you put in to help me, and others like me, learn about these technologies.
          Your message has been successfully submitted and would be delivered to recipients shortly.