Dark Bit Factory & Gravity

PROGRAMMING => Freebasic => Topic started by: ninogenio on August 02, 2006

Title: 3d motiom texture demo
Post by: ninogenio on August 02, 2006
 heres another little demo ive been bashing away at.

i had reall fun coding this one as theres a few bit and bobs in there ive not done before.

http://www.fastshare.org/download/3d_motion_texture.rar

have fun and as always if theres any of my code in there reusable feel free to rip it out ;)
Title: Re: 3d motiom texture demo
Post by: Clyde on August 03, 2006
Dude, very impressive indeed.

Cheers and nice one mate,
Clyde.
Title: Re: 3d motiom texture demo
Post by: ninogenio on August 03, 2006
cheers mate!
Title: Re: 3d motiom texture demo
Post by: Dad1916 on August 03, 2006
Off to a good start, well done. O0 O0
Title: Re: 3d motiom texture demo
Post by: thrawn89 on August 03, 2006
The exe crashes on mine...

Further when I try to recompile it, I get like errors and warnings.

Quote from: Mr. Command Line
ninos_fonts.bi(15) : warning level 0: Function result was not explicitly set
ninos_fonts.bi(32) : warning level 0: Function result was not explicitly set
ninos_fonts.bi(44) : warning level 0: Implicit variable allocation, last_drw
ninos_fonts.bi(67) : warning level 0: Function result was not explicitly set
perspective_correct_filltri.bi(44) : warning level 0: Function result was not explicitly set
perspective_correct_filltri.bi(50) : warning level 0: Function result was not explicitly set
perspective_correct_filltri.bi(56) : warning level 0: Function result was not explicitly set
perspective_correct_filltri.bi(63) : warning level 0: Function result was not explicitly set
perspective_correct_filltri.bi(70) : warning level 0: Function result was not explicitly set
perspective_correct_filltri.bi(77) : warning level 0: Function result was not explicitly set
perspective_correct_filltri.bi(201) : warning level 0: Function result was not explicitly set
perspective_correct_filltri.bi(257) : warning level 0: Function result was not explicitly set
3d_demo.bas(196) : warning level 0: Function result was not explicitly set
3d_demo.bas(206) : warning level 0: Function result was not explicitly set
3d_demo.bas(219) : warning level 0: Function result was not explicitly set
3d_demo.bas(238) : warning level 0: Function result was not explicitly set
3d_demo.bas(261) : warning level 0: Function result was not explicitly set
3d_demo.bas(285) : warning level 0: Function result was not explicitly set
3d_demo.bas(309) : warning level 0: Function result was not explicitly set
3d_demo.bas(345) : warning level 0: Function result was not explicitly set
3d_demo.bas(361) : warning level 0: Function result was not explicitly set
3d_demo.bas(411) : warning level 0: Function result was not explicitly set
3d_demo.bas(437) : error 3: Expected End-of-Line, found: 'file'

   file = freefile
        ^
3d_demo.bas(439) : error 9: Expected expression, found: 'file'

   open p_filename for binary as #file
                   ^
3d_demo.bas(444) : error 3: Expected End-of-Line, found: 'file'

   close #file
          ^
3d_demo.bas(448) : error 9: Expected expression, found: 'file'

   get #file, , chunk_id
        ^
3d_demo.bas(449) : error 9: Expected expression, found: 'file'

   get #file, , chunk_len
        ^
3d_demo.bas(456) : error 9: Expected expression, found: 'file'

      get #file, ,char
              ^
3d_demo.bas(462) : error 9: Expected expression, found: 'file'
         get #file, ,qty
              ^
3d_demo.bas(465) : error 9: Expected expression, found: 'file'
      get #file, ,vertex_x
           ^
3d_demo.bas(466) : error 9: Expected expression, found: 'file'

      get #file, ,vertex_y
           ^
3d_demo.bas(467) : error 9: Expected expression, found: 'file'

      get #file, ,vertex_z
           ^
3d_demo.bas(267) : error 120: Too many errors, exiting


EDIT:
PS, I recopied this from the command line by hand, so a few of the line numbers may be a little off, I try to double check, but Im dixlexic with numbers...

Sorry...
Thrawn
Title: Re: 3d motiom texture demo
Post by: Shockwave on August 03, 2006
Hehe, cool one Nino! Complete with a proper 1980's track by 2 unlimited. I was a bar man when that song came out, I hated it then but hearing it now brings back some happy memories so thank you for that!
Title: Re: 3d motiom texture demo
Post by: ninogenio on August 04, 2006
hehe cheers guys,

as too your problems thrawn im stumpd ??? sorry that you had to go to the trouble of recopying all the lines  by hand mate.
what version off freebasic do you have?
Title: Re: 3d motiom texture demo
Post by: relsoft on August 04, 2006
Nice.  I don't see any perspective on the cube's vertices though. Is that intentional?
Title: Re: 3d motiom texture demo
Post by: ninogenio on August 04, 2006
yeah i guess i should have maby added lighting or something to show a bit more perspective but its really just a bit of fun atm im actually not into pixel wize demos that much id like to be using gl for most of this stuff but im trying to learn a bit more about these effects just now.
Title: Re: 3d motiom texture demo
Post by: thrawn89 on August 04, 2006
0.16b, yeah I am confused as well  ???

Thrawn
Title: Re: 3d motiom texture demo
Post by: Shockwave on August 04, 2006
Nino, what Rel meant I think is that there is no perspective transformation on the cube :)
Title: Re: 3d motiom texture demo
Post by: relsoft on August 05, 2006
Yep@Shock. that's what I meant. :*)
Title: Re: 3d motiom texture demo
Post by: ninogenio on August 06, 2006
im sorry im confused do you mean theres no perspective mapping on the triangle interpolations as that got cut out for speed?
Title: Re: 3d motiom texture demo
Post by: Shockwave on August 06, 2006
Nope.

To explain what we mean, if you take a cd case or something like that and put it close to your eyes and look down it you'll notice that the far end of the cd case looks smaller. Things that are far away appear smaller to the human eye and the far points of 3D objects are usually transformed to give a similar effect. The cube doesn't appear to have this perspective distortion on it and looks a little strange. It doesn't look bad but it would look better if you added the perspective distortion to it.
Title: Re: 3d motiom texture demo
Post by: ninogenio on August 07, 2006
ahh right sorry guys im a bit fickle,

there is perspective calcs done on the vertices if you look in the turn object function but i hacked them a bit to work better with a normal texture.the problem comes in that the edges of the textures are black and ive got the back of the cube on fire so it does make the cube look extra flat ahh well i guess its something too remember in future cheers for the feedback though!
Title: Re: 3d motiom texture demo
Post by: DrewPee on August 11, 2006
Not sure if it's just me but . . . i can't even download this file - when i click on the link it does go to a website but when i click on the download button it just goes to a blank(ish) screen!

 ???

DrewPee
Title: Re: 3d motiom texture demo
Post by: Shockwave on August 11, 2006
It's just because of the free hosting site Nino has put it on. The download is fast if you can work out where the download link is. It was obscured for me once by an advert, a ctrl+f5 refresh forced the link to appear. Dunno if that helps.
Title: Re: 3d motiom texture demo
Post by: Clyde on October 19, 2006
I love it loads just had another looksie.

A tip I can give you ( unless you allready know ) Nino dude is that if you have a function that isnt returning anything; use a sub instead mate and omit the return its not needed.

If you are using a function and wish to return a value, make sure that in both the declaration and routine of the function have what the value you are sending back. As you'll discover as I have, that in latest versions of FB you'll get errors.

For example:

Code: [Select]
Declare Function Value16( ByVal Number As Integer ) As Integer


Function Value16( ByVal Number As Integer ) As Integer

  Â  Dim M16
  Â  Â  Â  
  Â  M16=Number*16

  Â  Return M16

End Function
  Â

Btw I have seen a few people use m16=Function instead of the return m16.

Hope this is of some use dude,
Cheers - Clyde.
Title: Re: 3d motiom texture demo
Post by: DrewPee on October 20, 2006
Nice one Nino - love the flame effect - and your scroller code is cool - mmm gives me an idea for another scroller!!!

Drew
Title: Re: 3d motiom texture demo
Post by: ninogenio on October 20, 2006
 :cheers: mateis

@clyde yeah ive been doing lots of little test on fb lately and im learning much more about the quirks of it. i wrote this demo without knowing to much about fb but since then ive picked up loads.

@drew cool cant wait to see what you do!