Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: lionhearts beginner open gl lesson 1a

  1. #1
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    51
    Posts
    934
    Rep Power
    109

    lionhearts beginner open gl lesson 1a

    :

    Dear thinbasic, thinair friends, they are working as a 'beginner' with thinbasic and open gl ("TBGL"), will give here in this little column new informations...

    => I will write simple examples, change existing examples or create new ones...

    => First lesson: you can build two polygons (with three vertex) one of them with a floating color and a new little rectangle (box) with floating color...
    important is the vertex position (x,y,z) and the color input (description follows)...

    => I will try to explain it with easy words, because I am a newbie here too and have had only some less information about "open gl" themes, but I like it very much and it's amazing stuff, if you can imagine, you can build 3d scenes for games or teaching lessons :-)

    bye, the first input is done, I will try to make in a regularly way progress with my examples to show it here and every help or comment is welcome... :-)

    Infos: here comes my "first lesson" I have built after an existing example by petr schreiber 1) http://www.http://psch.thinbasic.com...sic_intro.html and a

    2) "nehe" lesson (good examples for beginner and advanced users) http://nehe.gamedev.net/

    and

    3) massive input into open gl themes of course for example here: a) www.opengl.org and here: b) http://de.wikipedia.org/wiki/OpenGL and here
    c) http://developer.nvidia.com/object/n...ngl_specs.html

    4) for basic and further inputs about "thinbasic": http://en.wikipedia.org/wiki/ThinBasic.

    ----------

    best wishes, good ideas and see you here,

    lionheart :-D, the description for the first lesson with colors will follow the next time

    ;D have fun with it
    Attached Images Attached Images
    Attached Files Attached Files
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: lionhearts beginner open gl lesson 1a

    Hi LionHead,

    very nice lesson, thanks a lot!

    Just two little details:
    • It is preffered to use TBGL_ResetKeyState(), TBGL_GetAsyncKeyState(-1) does the same, but it is esoteric. Mea culpa, TBGL website did not contained this information, I updated it now.
    • When rendering TBGL_Box, you do not need to use TBGL_BeginPoly / TBGL_EndPoly. Only TBGL_Color, TBGL_ColorAlpha, TBGL_TexCoord2D, TBGL_Normal,TBGL_Vertex are allowed between TBGL_BeginPoly / TBGL_EndPoly, as help file explains


    I attach tuned version.


    Thanks,
    Petr
    Attached Files Attached Files
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    51
    Posts
    934
    Rep Power
    109

    Re: box beginner open gl lesson 1b



    => theme: "box beginner open gl lesson 1b"

    hello again dear thinBasic friends !

    part two: here it comes... now a little open gl "box" example with colors, translating the position of boxes and a new "close" window by the new "thinBasic" 1.7.0.0 version :-) GOOOD! :-D

    this little example is just a first example how to translate (later rotate) primitives, here a box object... - I have to improve it in some direction, but this chapter is long ! ;-)

    more will come... :

    bye and servus, lionheart
    Attached Images Attached Images
    Attached Files Attached Files
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  4. #4
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    51
    Posts
    934
    Rep Power
    109

    Re: lionhearts beginner open gl lesson 1b

    hello thinBasic TBGL friends ;-)

    I have modified with a new cube my last beginner open gl lesson 1b

    -- perhaps somebody can help or I can wait until petr will come back :-)

    qt 1): I have added a new little box (blue color) below the other ones...

    => This "box" had "bad" edges...(unsharp edges).. why? May be a rendering problem or it depends on the camera position?

    qt 2): If I want to translate the object to another place and rotate it, I must do it for every object or it's possible to include it the push-popMatrix as one loop? ??? this problem I have today, nothing else...


    best regards, nice day without our "heroes" :

    lionheart

    ps: sorry, forgotten the attachement...
    Attached Images Attached Images
    Attached Files Attached Files
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  5. #5

    Re: lionhearts beginner open gl lesson 1b

    Quote Originally Posted by Lionheart008

    best regards, nice day without our "heroes" :
    Now that is very motivating for the rest of us. :-\

  6. #6

    Re: lionhearts beginner open gl lesson 1a

    qt 1): I have added a new little box (blue color) below the other ones...

    => This "box" had "bad" edges...(unsharp edges).. why? May be a rendering problem or it depends on the camera position?
    Ok, you used TBGL-BOX, which creates a 3D box. With the first one you created, there was only one side visible for you. So this way you thought, that you created a rectangle. But as you created a box , once you move it out of the center from the camera view, you will see some other sides too. With the use of TBGL_POLYGONLOOK you can see that yourself.

    [code=thinbasic]'-------- build a 2. box
    TBGL_PolygonLook %GL_LINE
    TBGL_COLOR 0, 0, 255+sin(Timer)*127
    tbgl_Box 0.5, 1.0, 4.0
    TBGL_PolygonLook %GL_FILL
    [/code]


    Maybe it is better to use just a 4side polygon.

    qt 2): If I want to translate the object to another place and rotate it, I must do it for every object or it's possible to include it the push-popMatrix as one loop?
    Yes, or you take the current matrix postion/rotation into count yourself. In my oppinion that would be crazy. The Push/Pop matrix commands help you to retrieve clear matrix transformations for the next transform/rotate operation.

    But you don't need to do this, if you start using entities in TBGL, there you handle objects. And there TBGL takes care of the transformations during the rendering.

  7. #7

    Re: lionhearts beginner open gl lesson 1a

    .

  8. #8
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    51
    Posts
    934
    Rep Power
    109

    Re: lionhearts beginner open gl lesson 1b

    dear michael... good idea ;-)

    a) I have tried it with your advice polygon look GL_Line and GL_QUADS, but nothing has changed with the both edges of the quad (up right, up left)... ;-( it looks like the edges are cut off ...

    b) perhaps I will try the next example with a 4 side polygon !

    c) sorry, about the word "heroes".. it was for me a "nice" (friendly) word to all the people here they are full of inspiration, skill and positively help behaviour (you too! :-)))...

    I didn't want to 'demotivate' you, sorry again...

    thank you for help... ! :-) more open gl examples will come...

    lionheart
    Attached Files Attached Files
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  9. #9
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    51
    Posts
    934
    Rep Power
    109

    Re: lionhearts rotating boxes :-)

    hello again... my 5 cent for today :

    ... this new 'rotating box example' does function very well :-)

    I have load a new file (with 3d Entity, an skeleton open GL example with one white box) and have included three new boxes... two boxes turning round the basic cubes, so I can imagine some day a little planet will cruising around the sun :

    ;D

    - what I have done?

    a) changed the colors of the boxes
    b) changed the rotating speed
    c) changed the translation points

    that's all for today...

    I am satisfied again... this example runs, but the old problem (above) stay here with the bad edges (must laugh!).. I will fetch it, I am sure...

    have a nice day, ciao und servus, lionheart
    Attached Images Attached Images
    Attached Files Attached Files
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  10. #10

    Re: lionhearts beginner open gl lesson 1a

    ??? Bad edges? Do you mean the edges(Kanten) or corners (Ecken). Do you mean that the edges are drawn unsharp? If that is what you ment, then it caused by antialiasing of your videocard. The "missing corners" are not really missing. Itis the perspective after you rotated the box. To look at as a wireframed box and not a filled model, I want to point that part to you.

    Maybe PM me in german, so I can understand better what you mean.

Page 1 of 2 12 LastLast

Similar Threads

  1. NeHe Lesson 01
    By matthew in forum TBGL Tutorials
    Replies: 1
    Last Post: 16-03-2007, 06:38
  2. NeHe Lesson 04
    By matthew in forum TBGL Tutorials
    Replies: 0
    Last Post: 16-03-2007, 01:06
  3. NeHe Lesson 03
    By matthew in forum TBGL Tutorials
    Replies: 0
    Last Post: 16-03-2007, 01:01

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •