Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - TheMachine02

Pages: 1 ... 5 6 [7] 8 9 ... 32
91
Miscellaneous / Re: Post your desktop
« on: February 04, 2014, 12:33:02 pm »
my new wallpaper  ;D

Spoiler For Spoiler:


I actually like to take screen from the game I am playing  :P

92
TI Z80 / Re: Racing game (revived)
« on: January 28, 2014, 06:18:10 am »
I think GlassCars has some bridges, but the graphics were really rudimentary.

Yes there is some sort of height where you can jump of (and some sort of a rudimentary physic engine) .

Speaking of line cliping, it's *look* like it clip everything in 3D too, but in a very agressive way and with a far plane. That can be understanded, seing that with this method, point are always on screen, and thus no need for a 2D cliping. However, it's true that it look weird.

Anyway, can't wait to see progress. It sound very promising  :D

93
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: January 20, 2014, 01:02:06 pm »
minor update that should hopefully fix a bug with double camera. Also optimize some commands.

94
TI Z80 / Re: Racing game (revived)
« on: January 19, 2014, 08:35:55 am »
wow it's look good  :D It is always great to see GLib used

Anyway, here a screenshot of glasscar :


95
TI Z80 / Re: [Axe] - GLib TUTO
« on: January 15, 2014, 02:00:40 am »
O_o I guess I've change the syntax, and I forget that I've chnage it. Thanks for the report  ;D . The tuto have been updated.

96
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: January 14, 2014, 02:29:17 pm »
Main Library finally completed ! ( exepct for minor updtae such as little optimization) ; but the whole syntax will not ever change  :D
I started to update tuto is consequence too.

97
TI Z80 / Re: [Axe] - GLib TUTO
« on: January 14, 2014, 02:19:17 pm »
yep, I will explain VBO - especially for the structure. So you can still generate Vertex on fly  :P


EDIT : tuto have been placed on the first post, with warning for those unupdated.

98
TI Z80 / Re: [Axe] - GLib TUTO
« on: January 14, 2014, 01:45:51 pm »
thanks  :D

99
TI Z80 / Re: [Axe] - GLib TUTO
« on: January 14, 2014, 01:44:17 pm »
New tuto using the new GCORE and final version !

I puting this here, to don't make confusion with other.


First of all, please download the file attached to this post, (not in the GLib main thread, 'cause I didn't update it) (GCORE).
Last version is 2.0 omega
Place it preferably in archive : warning ! this file is pretty huge (6400 bytes !!).


I THE BASIS

Let's create a rotating cube !

First of all, include the GCORE prog inside of your axe source :

Code: [Select]
prgmGCORE

Once you did this you have access to all the GLib functions.


We need to define the 3D coordinates of each point of the cube, so we can rotate and display them afterwards.
Those points are just a bunch of data, so no real explanations are needed here :
Code: [Select]
Data(40r,-40r,40r)->GDB1
Data(40r,40r,40r
Data(-40r,-40r,40r
Data(-40r,40r,40r
Data(40r,-40r,-40r
Data(40r,40r,-40r
Data(-40r,-40r,-40r
Data(-40r,40r,-40r

Just remember that a 3D point is always defined as X,Z,Y using the standard 3D axis (X goes from left to right, Y from down to up and Z from near to far). Each coordinate takes 2 bytes, so don't forget the r.

By default GLib has no camera defined. So we must specify what type of camera we want to use.
In this example, I want to be able to rotate my cube : this is a GMODELVIEW camera (I don't want the camera to move, only the model to rotate).

The function to define a camera is :

Code: [Select]
GNewCam(pointer to camera)
.Destroys r1

**But but but .... I don't know how to create my camera, and I need a pointer to it !
STOP don't worry, GLib provides two pointers to some really basic cameras ! These are the °GMODELVIEW and °GWORLDVIEW cameras.

So I just give one of those pointers to the function and my new camera is created :

Code: [Select]
GNewCam(°GMODELVIEW)
Glib also need a special structure, allowing easy vertex processing/clipping. It's called a VBO : vertex buffer object. Basically, it's just a ram area.
You need at the begining of your program to generate such structure :

This is the command used :
Code: [Select]
GGenVBO(size,data_to_match)
.destroy r1,r2
your size is the number of vertices you want to have.
data_to_match is the raw (not processed) vertices coordinates (here it's GDB1)
It also set the current VBO to the one created , so it will be used by all other command.

The function return a special value, that you have to store somewhere : it's the VBO id.
We now have this :

Code: [Select]
GGenVBO(8,GDB1)->G
.I used G, but you can used any way to save this value


Now we can start the main loop, with 3D calculations :

Code: [Select]
While 1
GUpdateVBO(G,0,7)

this piece of code "update" (transform the vertices) for the specified VBO. You can see that we are passing the id we have previously store.
0 and 7 are the start and the end of vertices we should transform. Here it transform from the vertx 0,...., to the vertx 7 (the last one)

And now we want display our points.
GLib provide the
Code: [Select]
GVBOPoint(id_vertex)
.destroy r1
function to retrieve a point from VBO. It's store the x-coord and y-coord on screen to GScreenX and GSreenY var (alias OP1 and OP1+2)
It also return in hl a clipping information : 0 if the point is visible, anything else (=/= from 0)

We can now write this :
Code: [Select]
For(M,0,7)
GVBOPoint(M)
!If
Rect(GScreenX,GScreenY,2,2
End
End

the code loop from the first vertice, to the last one, retrieve on screen coordinate and then disp it if it is visible.


We need now to handle the arrow keys, so we can rotate our cube. GLib provides an in-built function, which handles everything (life is beautiful isn't it  :P)

It's the GGetkey function.
The call is:
Code: [Select]
GGetkey()

End of the code :

Code: [Select]
GGetkey()

DispgraphClrdraw   // we want to have something on screen !
EndIf getkey(15) // stop the While loop if [clear] is pressed


Now time to compile it ... aaaaaaaaaand ...



It works ! :D

100
TI Z80 / Re: [Axe]Binary Error - a GLib demo
« on: January 13, 2014, 06:43:56 am »
IMO you should vary a bit from showing rotating vertices ...

yeah I know. But when I've done this, line was totally buggy ; and polygon was a waaaaaaaaay to big. (I am not going to do a demo larger than 4000 bytes  :P ). So vertices was all I got....
It was also a way for me to train generate vertices on the fly  ;D

101
TI Z80 / GLIB poll and FAQ
« on: January 13, 2014, 06:27:41 am »
 The poll I said in main topic, and if anyone have a question about using the Library, well you can specify it here.

Just to specify :
GCORE have VBO, rotation, projection, cliping, vertex shader, camera gestion (getkey), and main function.
Do you see function that I can add to it or it is enough ?

102
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: January 13, 2014, 06:24:44 am »
thanks  :D

So, I included all of this new stuff (cliping, vbo) Inside GCORE Library. One good thing with VBO is that now all main function are compatible with app  :p  (except for shader and double camera, but I have to reprogram shader anyway, and camera fix is easy).


The size is now +-3200 for a test program, wich I think should be the limit for the main Library, but I don't really know what should be part of it. So I am putting a poll  about what I have to concenter next ;D

103
TI Z80 / [Axe]Binary Error - a GLib demo
« on: January 12, 2014, 11:29:04 am »
I try to do a demo for GLib and here the result. This is a succession of short sequence, the whole thing last 1 min.
This is at 6MHz and the file is 3800 bytes.

Enjoy  :D


104
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: January 12, 2014, 05:32:34 am »
I bet you'll make it possible to render faster than light :P

Wish granted  :P I love trivial accept.


32.5fps !!!!!!  :crazy:

105
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: January 11, 2014, 10:09:30 am »
yep, it really annoy a long time.

I've just done speed test :
-34 fps for buggy cliping
-23 fps for perfect one.

The drop is important ; and I understand it seing all the calculation engine has to do. I will see if I can cache one to get speed.

Pages: 1 ... 5 6 [7] 8 9 ... 32