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 ... 19 20 [21] 22 23 ... 32
301
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: April 29, 2013, 10:01:00 am »
I'm sure you can do something. Maybe speed up the GSort() command by changing the sort algorithm ?

302
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: April 28, 2013, 12:48:00 pm »
If someone want to make a game of it, just ask me if there is a problem, or something is not clear...  :)

And of course I will be happy if you credit me and the other developpers  :P .

303
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: April 26, 2013, 11:40:30 am »
Why would anyone but a developer want the source?

it was just to prevent not to download it  ;D
else, here the readme

304
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: April 25, 2013, 01:34:12 pm »
the current source (DEVLOPPERS ONLY)

305
News / Re: DJ Omnimaga reaches 50k posts; everything explodes
« on: April 25, 2013, 08:53:46 am »
wow great   :D

how many posts you will have in the futur ? ...

306
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: April 24, 2013, 09:42:24 am »
It was planned  ;D

307
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: April 24, 2013, 09:27:59 am »
that very great !
I sending you right now a very well commented code (the last  :P ), but I don't think I will use your routine, because I need a moar complex one...

308
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: April 24, 2013, 09:01:06 am »
That could be very great thanks ! Optimized texturing is something very hard to do.  :P

are not fluent with 3D and such stuff

In fact I now have trouble with some 2d technique and not with 3d  ;D ; especially with cliping against a polygon (picture level) or texturing. Lights will not be so hard to implement, thought.

309
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: April 23, 2013, 12:24:12 pm »
the next things I have to do (light, portal,textures...) are ... difficult for me alone  :angel:

That why I call for good axe programmeur to join me and work on this ! :thumbsup:

Tell me if you want to be in part of the librairy...

310
Axe / Re: [TUTO] How to make get rid of line clipping in Axe!
« on: April 18, 2013, 11:05:03 am »
It's extremly hard to get a super optimized line cliping (I work on it since 2 week  :'( )
For what I do, 3D, I need a routine, but a particular one : cliping against a polygon. I can do with the following code (C, find on net), but it's not enough fast  D:

Code: [Select]
// Cyrus-Beck 2-D Line Clipping algorithm
// for ease of coding we will treat a 2D point and a 2D vector
// as the same
struct Point2D
{ float x,y;
}
// for simplicity we set an upper bound on the number of
// points allowed to define a polygon - by moving to a class
// with a constructor we could make the array any size we wanted
const int MAXP = 100;
struct Polygon
{ int nPoints;
  Point2D v[MAXP];
}
const int MAXN = 100;
typedef Point2D Normal[MAXN];

// compute the outer normals. 
// note that this requires that the polygon be convex
// to always work
void CalcNormals (Polygon p, Normal & n)
{ int i,j,k;
  point2D v;
  for (i = 0; i < p.nPoints; i++)
  { j = (i+1)%p.nPoints;
    k = (i+2)%p.nPoints;
    // make vector be -1/mI + 1J
    n[i].x = -(p.v[j].y - p.v[i].y)/(p.v[j].x - p.v[i].x);
    n[i].y = 1.0;
    v.x = p.v[k].x - p.v[i].x;
    v.y = p.v[k].y - p.v[i].y;
    if (DotProduct (n[i],v) > 0)    // inner normal
    { n[i].x *= -1;
      n[i].y  = -1;
    }
  }
}
   
float DotProduct (Point2D v1, Point2D v2)
{
   return v1.x*v2.x + v1.y*v2*y;
}

void CBClip (Point2D p1, Point2D p2, Normal n, Polygon p, Boolean & visible,
                     Point2D & rp, Point2D & q)
{ float t1,t2,t,num,den;
  Point2D dirV,F;          // vectors
  int I;
 
    // start largest at smallest legal value and smallest
    // at largest legal value
  t1 = 0.0;
  t2 = 1.0;
   // compute the direction vector
  dirV.x = p2.x - p1.x;
  dirV.y = p2.y - p1.y;

  visible = TRUE;
  i = 0;
  while ( (i < p.nPoints) && visible)
  { F.x = p1.x - p.v[i].x;
    F.y = p1.y - p.v[i].y;
   
    num  = DotProduct (n[i],F);
    den   =  DotProduct (n[i],dirV);

    if (den == 0.0)          // Parallel or Point
    { // parallel - if outside then forget the line; if inside then there are no
      // intersections with this side
      // but there may be with other edges, so in this case just keep going
       if (num > 0.0)
        visible = FALSE;   //   Parallel and outside or point (p1 == p2) and outside
    }
    else
    { t = -(num/den);
      if (den < 0.0)        // entering
      { if (t <= 1.0)
          if (t > t1)
            t1 = t;
      }
      else if ( t >= 0.0)    //exiting
        if (t < t2)
          t2 = t;
    }
    i++;
  }
  if ( t1 <= t2)
  { rp.x = p1.x + t1*dirV.x;
    rp.y = p1.y + t1*dirV.y;
    q.x = p1.x + t2.dirV.x
    q.y = p1.y + t2*dirV.y
  }
  else
    visible = FALSE;
}


maybe asm can help, though

311
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: March 19, 2013, 01:39:29 pm »
yes. for the engine, polygon is just 3 or 4 points, so you can perfectly do some horizontals faces
The only problem with horizontal face is that the lightning engine doesn't support this type of face (but I will fix this)

312
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: March 19, 2013, 01:35:00 pm »
2/3/4->°GGrey is a good idea. I will implement it in the next version  :)

and thanks for all support !

313
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: March 18, 2013, 01:49:38 pm »
BIG UPDATE    :w00t:

-new command
-syntax command have change
-full support for 3,4 greyscale lvl and blck and white
-some very basic lightning stuff
-sorry no texture  :-\

List of command
-special command :
must be the first thing after the axe header, and they all must be here
-0/1->°LightOn    toggle on/off the lightning engine (save weight if you don't need it)

-0/1->°GBW
-0/1->°G3GreyLVL
-0/1->°G4GreyLVL     one of these three command must be on, and only one : choose the mode of display

-commands :
-GInit(FLAG)
init the declaration of vertex
FLAG is °GTRIANGLE or °GQUADRI

-GVertex(X,Z,Y)
define a vertex
draw when there is 3,or 4 vertices defines, depend on the FLAG option

-THE GEND() FUNCTION HAS BEEN REMOVE

-GRestoreID(NB_OF_FACE)
restore the list use for GDrawArray

-GSortID(ADD,NB_OF_FACE)
sort the faces  depending of the distance from the point in ADD and the pos of camera
ADD have the following format :
Data(X,Z,Y,X2,Z2,Y2 ...

-GDrawArray(ADD,NB_OF_FACE)
draw an array of vertex who have the following format :
Data(Norm,COLOR
Data(X,Z,Y
....
The number of vertex depend of the FLAG use to init
you can skip the second parameter if you have used GSortID() just before
color is all the following FLAG+ the flag °GLAMBERT, if you want to use light


FLAG->GColor
set the current face color

FLAG is :
in B&W mode
°GWHITE
°GBLACK

in 3GreyScale LVL
°GWHITE
°GGREY
°GBLACK

in 4 greyscales LVL
°GWHITE
°GGREY30
°GGREY60
°GBLACK

in all mode :
°GTWHITE   (wired aspect)

to use a light:
before the main loop put :
-1->{°GLIGHT}^r
in or before :
X->{°GLIGHT+3}
where x is the norm of the light

after, before the vertices def., you place GCalcLight(NORM_OF_FACE)->GColor at the place of FLAG->GColor
or use °GLAMBERT Flag if you use GDrawArray()

-GGetkey()
handle all the getkey


next step :
-Light at the same time than a Color definition (add the two)
-Texture

and two screenshot, B&W mode; 3 GreyLVL Mode, the  lib (ver 0.1) and the example prog  (note that I temporaly remove the Splash screen)


314
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: February 28, 2013, 03:43:49 am »
What does the 42 mean then D:
(except the answer to life, the universe and everything)

it's the FOV use to render.

According to the screenie, I would say more like 4.2 or 5 :P

no, for the frame, it's more 10fps (the screenshot is more slow than the real calc  :P)

315
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: February 26, 2013, 12:36:03 pm »
It still doesn't draw lines whose endpoints are offscreen. Are you planning on changing that or should I stop pestering you about it? :P

yes, I planing to change that ; but I need first to optimize the engine itself (and after I will see for this)
However, it's true that doing a very optimized clipping line routine is a little hard...

Pages: 1 ... 19 20 [21] 22 23 ... 32