gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > is this real 3d ?

#9652 - f00l - Tue Aug 12, 2003 11:15 am

uhm.. I would like to know if this is real 3d ...


Code:

#include "mygba.h"
#include "gfx/gun.raw.c"   // de gun, die zit hier NIET bij
#include "gfx/gun.pal.c"   // de gun, die zit hier NIET bij
MULTIBOOT
u8 gun[1];                 // de gun, die zit hier NIET bij

int main(void)             // Het begin van de echte code
{

 ham_Init();               // Even de HAM lib aanspreken
 u8 i;                     // I defineren (maakt niet uit welke letter)
 u8 j;                     // J defineren (maakt niet uit welke letter)
 u8 y=80;                  // Y defineren (maakt niet uit welke letter)       
 u8 z=30;                  // Z defineren (maakt niet uit welke letter)
 u8 x=120-z-z;             // 120 is het midden en daar hallen 2 x Z af
 u8 x2=x+z+z+z+z;          // 120 is het midden en daar zetten we 2 x Z bij

 
ham_SetBgMode(4);          // BG mode instellen
   
   

// de gun sprite instellen

ham_LoadObjPal(&gun_Palette, 256);     
gun[0] = ham_CreateObj(&gun_Bitmap,0,2,OBJ_MODE_NORMAL,1,0,0,0,0,0,0,110,132);



  // teken sprite
  ham_CopyObjToOAM();

   


   TOOL_SET_BG_PAL_256(0,0,0,0) 
   TOOL_SET_BG_PAL_256(1, 0, 0, 128)      // Donker blauw
   TOOL_SET_BG_PAL_256(0,0,0,0)   
   TOOL_SET_BG_PAL_256(2, 0, 0, 255)      // licht blauw
   TOOL_SET_BG_PAL_256(0,0,0,0) 
   TOOL_SET_BG_PAL_256(3, 128, 128, 128)  // donker grijs
   TOOL_SET_BG_PAL_256(0,0,0,0) 
   TOOL_SET_BG_PAL_256(4, 192, 192, 192)  // licht grijs




   while(1)                               // loop4ever
   {
    ham_ClearBackBuffer(0);               // BG leeg gooien
   
for(j=0; j<61; j++)                       // ff snel 61 lijnen teken
{
 ham_PutLine(0,0+j,240,0+j,3);            // ff snel 61 lijnen teken
 ham_PutLine(0,160-j,240,160-j,4);        // ff snel 61 lijnen teken
}

 
for(i=0; i<61; i++)
{
          ham_PutLine(0,y-z+i,x2,y-z+i,2);  // de lijn mode :
          ham_PutLine(0,y+z-i,x2,y+z-i,2);  // X1,Y1 en dan X2,Y2 en kleur
          ham_PutLine(x2,y-z+i,240,y-z+i,1); 
          ham_PutLine(x2,y+z-i,240,y+z-i,1);                                                                               
          ham_PutLine(0,160-i,x,y+z,2); 
          ham_PutLine(0,0+i,x,y-z,2);     
          ham_PutLine(240,160-i,x2,y+z,1);
          ham_PutLine(240,0+i,x2,y-z,1);                                       
 }                       

   
      ham_PutLine(0,0,x,y-z,1);
      ham_PutLine(0,160,x,y+z,1);
      ham_PutLine(240,0,x2,y-z,1); 
      ham_PutLine(240,160,x2,y+z,1);   
     

      // Controlls

           if(F_CTRLINPUT_UP_PRESSED    ) { if(z<56){ z++; }}
      else if(F_CTRLINPUT_DOWN_PRESSED  ) { if(z>30){ z--; }}
      else if(F_CTRLINPUT_LEFT_PRESSED  ) { if(x<240){ x++; x2++; }}
      else if(F_CTRLINPUT_RIGHT_PRESSED ) { if(x>0){ x--; x2--; }}
     

      // en weer lekker de BG buffer flippen
     ham_FlipBGBuffer();
   }
}

_________________
woei!

#9659 - f00l - Tue Aug 12, 2003 6:37 pm

aah.. come on people.. I've seen over 10000 3D engines for gba.. so there must be someone that can tell me if this is 3D...

I think it's 3D when it has 3 axe's .. X , Y , Z .. is that correct ?
_________________
woei!

#9671 - jenswa - Wed Aug 13, 2003 11:42 am

Eej, komt die niet van Insania van gbaparty.nl?

But it's 3d, very simplistic.
_________________
It seems this wasn't lost after all.

#9681 - f00l - Wed Aug 13, 2003 7:05 pm

how do you know it's 3D then ? just because some dude told you it was 3D ? or because you really know if it's 3D ?
_________________
woei!

#9682 - jenswa - Wed Aug 13, 2003 7:26 pm

By looking at the pictures, supplied with the source,
i must say, it could also be a raycaster but the edges
are too smooth, raycaster is more blocky.

But i am not convinced, since the only thing i've seen
are still images, so i understand your thoughts.
_________________
It seems this wasn't lost after all.

#9700 - f00l - Thu Aug 14, 2003 2:37 pm

well.. if you look at the code you can see it's not raycast.....
_________________
woei!

#9706 - jenswa - Thu Aug 14, 2003 5:11 pm

Oh it's not raycast,
what can it then be? 2D?
Why do ask?
_________________
It seems this wasn't lost after all.

#9709 - Maddox - Thu Aug 14, 2003 5:30 pm

f00l,
you chose and apt username for this forum! if you have seen over 10,000 3d engines, why the [censored] can't you figure it out yourself. Step into the street when a bus is coming and try to figure out if that's 3D. Please? This has to be the stupidest post since anything link wrote.

Captain Maddox!
_________________
You probably suck. I hope you're is not a game programmer.

#9714 - f00l - Thu Aug 14, 2003 6:48 pm

I asked : I think it's 3D when it has 3 axe's .. X , Y , Z .. is that correct ?

I've seen a lot of 3D engine's but none of them did it on this way,
and I want to know if THIS is 3D ...
_________________
woei!

#9715 - jenswa - Thu Aug 14, 2003 7:26 pm

If you already knew it, why asking?
And i told you it was 3d.

Or does 3d have 3 axis? oh no that's 4D!
_________________
It seems this wasn't lost after all.

#9717 - f00l - Thu Aug 14, 2003 8:12 pm

no..no..no!


jenswa this is what you said :
But i am not convinced, since the only thing i've seen
are still images, so i understand your thoughts.

and the only reason you thought it was 3D is because some dude
said it ...but you don't really know anything about it... :S
_________________
woei!

#9723 - FluBBa - Fri Aug 15, 2003 7:53 am

What is needed for it to become 3D?
Well for starters you need some kind of object/enviroment in 3D, and it looks like there should be a gun or whatever it is in this source.
You'd probably like to rotate it also to be able to appreciate the thing from a lot of angles. None in this source.
Last you want a convincing translation from 3D to 2D, right? Can't find any 3D to 2D perspective thing here.
So if you want to call this 3D..... naaaah.
_________________
I probably suck, my not is a programmer.

#9725 - tom - Fri Aug 15, 2003 9:08 am

I think it's 3D when it has 3 axe's .. X , Y , Z.

end of discussion =D

#9741 - Lord Graga - Fri Aug 15, 2003 6:12 pm

It would be nice to see the compiled rom, since most of us doesn't use HAM.

#9743 - f00l - Fri Aug 15, 2003 7:27 pm

sure... here you go :)

I didn't use SIN or COS because I wanted to keep it simple... so no 360 degree rotation.. it's also very slow because I used to put-line function to fill the walls

http://www.fraggersxtreme.com/~mamenl/3d.gba
_________________
woei!