• Glib : a 3D graphics axe library 5 1
Currently:  

Author Topic: Glib : a 3D graphics axe library  (Read 89905 times)

0 Members and 1 Guest are viewing this topic.

Offline TheMachine02

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 452
  • Rating: +105/-0
  • me = EF99+F41A
    • View Profile
Re: GLIB a graphics axe 3d librairy
« Reply #15 on: November 14, 2012, 10:21:07 am »
thank you a lot for the algorithm !

TheMachine, is it possible to increase the amount of precision when moving? It seems that the camera 'jumps' a lot :(

yes, this is easy it's just a number to change. (for the moment he add 16 for the angle, I can change it to 8)

AXE/asm programmer - unleash the power of z80 //C++//C

epic 3D things http://www.ntu.edu.sg/home/ehchua/programming/opengl/CG_BasicsTheory.html

Offline TheMachine02

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 452
  • Rating: +105/-0
  • me = EF99+F41A
    • View Profile
Re: GLIB a graphics axe 3d librairy
« Reply #16 on: January 08, 2013, 06:21:01 am »
a LOT of update !!!

it's now real 3d  :o  (using rotation and projection).

it's really fast, more than the last thing I use for 3d (using a LUT, still at 6MgHz,13 vertices);
and thanks to ben_g's algorithm, I was able to do a routine to fill a triangle (but this is a lot more slow  :P )(maybe decrease the precision is the solution...)

here the test prog and the commands
-rotation y axis [<-],[->]
-rotation x axis [del], [mode]
-zoom/dezoom [F1],[F5]
-up/down [F2],[F4]
-go forward/ [up],[down]
AXE/asm programmer - unleash the power of z80 //C++//C

epic 3D things http://www.ntu.edu.sg/home/ehchua/programming/opengl/CG_BasicsTheory.html

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: GLIB a graphics axe 3d librairy
« Reply #17 on: January 08, 2013, 06:57:13 am »
It still bothers me that you don't draw lines to offscreen vertexes, even if the other is on screen.
« Last Edit: January 08, 2013, 06:57:34 am by willrandship »

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: GLIB a graphics axe 3d librairy
« Reply #18 on: January 08, 2013, 07:33:18 am »
Will this result in playable games any time soon? Or will it be too slow?
If you like my work: why not give me an internet?








Offline TheMachine02

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 452
  • Rating: +105/-0
  • me = EF99+F41A
    • View Profile
Re: GLIB a graphics axe 3d librairy
« Reply #19 on: January 08, 2013, 11:51:26 am »
It still bothers me that you don't draw lines to offscreen vertexes, even if the other is on screen.

that the axe line routine and I'm too lazy to do one...

I prefer concentrate on speed, ligthning, and texture.

Will this result in playable games any time soon? Or will it be too slow?
for the moment, many thing can be optimised, but the speed allow me to try to make a demo of my 3d game Nemesis. I don't think I will finish this soon but you can be sure that I will finish it.
AXE/asm programmer - unleash the power of z80 //C++//C

epic 3D things http://www.ntu.edu.sg/home/ehchua/programming/opengl/CG_BasicsTheory.html

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: GLIB a graphics axe 3d librairy
« Reply #20 on: January 08, 2013, 08:33:04 pm »
That are some nice updates! I like the speed :D

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: GLIB a graphics axe 3d librairy
« Reply #21 on: January 08, 2013, 10:46:41 pm »
Just wondering what method you are using to store your rotations for each object? Euler angles? And will this be a full 6-dof engine? (like walking around engine or flight-sim?).

Also cohen-sutherland is a pretty straight-forward method for clipping lines if you're interested.

Either way it looks nice and fast! Great work :).
« Last Edit: January 08, 2013, 10:47:14 pm by tr1p1ea »
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: GLIB a graphics axe 3d librairy
« Reply #22 on: January 09, 2013, 01:55:27 am »
Glad this is still alive. Still hoping that you finish your game too :)

Offline TheMachine02

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 452
  • Rating: +105/-0
  • me = EF99+F41A
    • View Profile
Re: GLIB a graphics axe 3d librairy
« Reply #23 on: January 09, 2013, 09:19:21 am »
Glad this is still alive. Still hoping that you finish your game too :)
thanks. I know I could do the demo  :P but for the whole game maybe I will need some help (like spirite or creating the vertices of the world...)

Just wondering what method you are using to store your rotations for each object? Euler angles?
yes, I use it. In fact I store rotation for all the world, and when I render, I use pos cam and the angle to rotate each vertex, and then disp on screen using projection. that easy and fast  :)

And will this be a full 6-dof engine? (like walking around engine or flight-sim?).

errrrr.... ??? what is 6-dof engine ?
AXE/asm programmer - unleash the power of z80 //C++//C

epic 3D things http://www.ntu.edu.sg/home/ehchua/programming/opengl/CG_BasicsTheory.html

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: GLIB a graphics axe 3d librairy
« Reply #24 on: January 09, 2013, 09:49:44 am »
will this work with AXE? It's a really cool library!

Edit: It IS an AXE library, my bad!

Edit2: how do I use this in my program? (How to use as library?)
« Last Edit: January 09, 2013, 10:04:08 am by pimathbrainiac »
I am Bach.

Offline TheMachine02

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 452
  • Rating: +105/-0
  • me = EF99+F41A
    • View Profile
Re: GLIB a graphics axe 3d librairy
« Reply #25 on: January 09, 2013, 10:57:40 am »
for the moment, I didn't upload the last version ; but when I've done that,you download it and add at the begin of the programme

Code: [Select]
.GTEST
prgmGLIB
...
your code here
...

and you can use the function provide by the library. (describe in the readme)
(all of this make me thought that I must post the file  ;D ; but many function is not finish)
« Last Edit: January 09, 2013, 10:57:55 am by TheMachine02 »
AXE/asm programmer - unleash the power of z80 //C++//C

epic 3D things http://www.ntu.edu.sg/home/ehchua/programming/opengl/CG_BasicsTheory.html

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: GLIB a graphics axe 3d librairy
« Reply #26 on: January 09, 2013, 02:16:52 pm »
I'm talking syntax and what do the functions do... I know how to USE the library, just not how to program with it.
I am Bach.

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: GLIB a graphics axe 3d librairy
« Reply #27 on: January 09, 2013, 03:34:24 pm »
Sorry when i say 6-dof i meant '6-degrees of freedom' as in you can reliably move in all directions in 3d space.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline TheMachine02

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 452
  • Rating: +105/-0
  • me = EF99+F41A
    • View Profile
Re: GLIB a graphics axe 3d librairy
« Reply #28 on: January 10, 2013, 11:06:10 am »
Sorry when i say 6-dof i meant '6-degrees of freedom' as in you can reliably move in all directions in 3d space.
ok. Basically I can do it but I haven't implemented this yet.

I'm talking syntax and what do the functions do... I know how to USE the library, just not how to program with it.
And here we are. The new library.

There is 4 important function.
GpGet() : handle the getkey
arguments : none
return : none

-rotation y axis [<-],[->]
-rotation x axis [del], [mode]
-zoom/dezoom [F1],[F5]
-up/down [F2],[F4]
-go forward/ [up],[down]

GpBegin(FLAG) : init the declaration of vertices
arguments : FLAG
choose between
GPQUADRI : the next vertices will be traited as an rectangle (need 4*nb poly vertices)
GPTRIANGLE : " as a triangle     (need 3*nb poly vertices)
return : none

GpVertex(X,Z,Y) : define a vertex
arguments : the position of the vertex
return : none

GpEnd() : finish the declaration of vertices and draw with black shape (you will can change this in the future)
if the number of the vertices is not good compare with the FLAG, return directly without drawing anything
arguments : none
return : none

If you look at the librairy, you will see many other functions. (GpRotated, GpPerpective,GpFace)
there are useless for the moment, so please don't use them !

The librairy use L1, compilated it does 4507 octets (big I know, but I am working on) and use pic1.

must use with axe 1.2.1a, (do to the 13 characters long and #ExprOn)

here an example prog :

Code: [Select]
.TEST
prgmGPLIB
While 1
GpBegin(GPTRIANGLE)
GpVertex(0,-10,0
GpVertex(0,10,0
GpVertex(20,10,0

GpVertex(20,-10,0
GpVertex(20,10,0
GpVertex(0,-10,0

GpEnd()

DispgraphClrDraw
Repeat getkey(0)
End
GpGet()
EndIf getkey(15)
Return

(I know this is slow but it's in 6MgHz  ;D)
« Last Edit: January 10, 2013, 11:06:42 am by TheMachine02 »
AXE/asm programmer - unleash the power of z80 //C++//C

epic 3D things http://www.ntu.edu.sg/home/ehchua/programming/opengl/CG_BasicsTheory.html

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: GLIB a graphics axe 3d librairy
« Reply #29 on: January 10, 2013, 12:51:59 pm »
Awesome!!!

Thanks for the help and the update!
I am Bach.