Author Topic: A little "HowTo" use OpenGL in GLBasic  (Read 17704 times)

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5006
  • O Rly?
    • View Profile
Re: A little "HowTo" use OpenGL in GLBasic
« Reply #15 on: 2014-Aug-14 »
I can try to make a tutorial to get more in detail.
But maybe in german, my english is a bit awkward  :S
So i need a native speaker to translate...
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1618
  • Particle Hawk
    • View Profile
Re: A little "HowTo" use OpenGL in GLBasic
« Reply #16 on: 2014-Aug-15 »
You are very fluent, i can understand you 99.99% of the time...which is alot better than some of the natives around here in Florida.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: A little "HowTo" use OpenGL in GLBasic
« Reply #17 on: 2014-Aug-15 »
Alright now.  ;) I have created a demo using the sprite output from SBlectric's terrain generator and I had to modify the face library to include vertex coloring.  :zzz:

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4170
    • View Profile
    • Portfolio
Re: A little "HowTo" use OpenGL in GLBasic
« Reply #18 on: 2014-Aug-15 »
I will try to poke my nose where it dosen´t belong... :D
I have no idea how this is all happening, but say Matchy, can´t you UVmap the polygons instead?

edit: what? hard to understand Schranzor? Come on! just call Mentalthink and he will fix it up :)  (just joking of course Mental!)
« Last Edit: 2014-Aug-15 by erico »

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: A little "HowTo" use OpenGL in GLBasic
« Reply #19 on: 2014-Aug-15 »
Matchy says!  :D :D

The wrapper is fine and really is simple. It's the face library that needs improvements. For example, the association with type as arrays and converting them to.

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5006
  • O Rly?
    • View Profile
Re: A little "HowTo" use OpenGL in GLBasic
« Reply #20 on: 2014-Aug-18 »
Should i redo it to Vertex buffer object ( VBO )  ???
Ah... and the Rendering to Triangles/ Trianglestrips?
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: A little "HowTo" use OpenGL in GLBasic
« Reply #21 on: 2014-Aug-18 »
In the face library, you have random rgb color for testing but how are they set externally?  :S That was my only major issue because I have to include a color[4] array for that type.  ::)

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5006
  • O Rly?
    • View Profile
Re: A little "HowTo" use OpenGL in GLBasic
« Reply #22 on: 2014-Aug-18 »
remove the random once and extend the facetype to apply a color
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: A little "HowTo" use OpenGL in GLBasic
« Reply #23 on: 2014-Aug-18 »
Have you even looked at my source with that modified?  :'(

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5006
  • O Rly?
    • View Profile
Re: A little "HowTo" use OpenGL in GLBasic
« Reply #24 on: 2014-Aug-18 »
no ^^


REMOVE THIS:

Code: GLBasic [Select]
                               
LOCAL r# = RND(100)
LOCAL g# = RND(100)
LOCAL b# = RND(100)

glColor3f(r/100,g/100,b/100)

in FUNCTION createObject_test

but you don't use it  :S
« Last Edit: 2014-Aug-18 by Schranz0r »
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: A little "HowTo" use OpenGL in GLBasic
« Reply #25 on: 2014-Aug-18 »
Why not?  :whistle:

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5006
  • O Rly?
    • View Profile
Re: A little "HowTo" use OpenGL in GLBasic
« Reply #26 on: 2014-Aug-18 »
look at the other post
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: A little "HowTo" use OpenGL in GLBasic
« Reply #27 on: 2014-Aug-18 »
Now you are confusing just me.  :'( Did you, or anyone else, try out the terrain tiler?  :zzz:

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5006
  • O Rly?
    • View Profile
Re: A little "HowTo" use OpenGL in GLBasic
« Reply #28 on: 2014-Aug-18 »
ok i think i don't understand you right....

You have still random colors?
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3354
  • Integrated Brain
    • View Profile
Re: A little "HowTo" use OpenGL in GLBasic
« Reply #29 on: 2014-Aug-18 »
Schranz0r don't worry about your English I understand always 100% you say, in fact I only imagine you're German for the nick in the Avatar.