Dark Bit Factory & Gravity
GENERAL => Challenges & Competitions => Topic started by: relsoft on July 09, 2006
-
Press ALT+Enter when theprog runs ;*)
'I am crazy!!!
'Plasma and Floormapper in TextMode!!!
'Relsoft 2003
DECLARE SUB BlobsTxt (Intensity%)
DECLARE SUB DrawBlob (bx%, by%)
DECLARE SUB Mode7Text (sx%, sy%, sz%, horz%)
DEFINT A-Z
RANDOMIZE TIMER
CLS
SCREEN 0
WIDTH 80, 50
CONST PI = 3.14151693#
CONST FALSE = 0, TRUE = NOT FALSE
DIM SHARED Lsin1%(-1024 TO 1024)
DIM SHARED Lsin2%(-1024 TO 1024)
DIM SHARED Lsin3%(-1024 TO 1024)
DIM SHARED Lsin!(-10 TO 370)
DIM SHARED Lcos!(-10 TO 370)
 Â
  FOR i% = -1024 TO 1024
    Lsin1%(i%) = SIN(i% / (16)) * 16
    Lsin2%(i%) = SIN(i% / (32)) * 64
    Lsin3%(i%) = SIN(i% / (32)) * 8
  NEXT i%
  j! = 255 / 360 * 2
  k! = 255 / 360 * 8
  l! = 255 / 360 * 4
  FOR i% = 0 TO 255
    m% = INT(a!)
    n% = INT(b!)
    o% = INT(c!)
    r% = 63 * ABS(SIN(m% * PI / 180))
    g% = 63 * ABS(SIN(n% * PI / 180))
    b% = 63 * ABS(SIN(o% * PI / 180))
    a! = a! + j!
    b! = b! + k!
    c! = c! + l!
    OUT &H3C8, i%
    OUT &H3C9, r%
    OUT &H3C9, g%
    OUT &H3C9, b%
  NEXT
Dir% = 1
DEF SEG = &HB800
DO
  counter& = (counter& + Dir%)
  IF counter& > 600 THEN Dir% = -Dir%
  IF counter& < -600 THEN Dir% = -Dir%
  offset% = 0
  FOR y% = 1 TO 50
    FOR x% = 1 TO 80
      c% = Lsin3%(x%) + Lsin1%(x% + counter&) + Lsin2%(y% + counter&)
      c% = c% + Lsin3%(c%) + Lsin1%(c% + counter&) + Lsin2%(counter& - y% + x%)
      POKE offset%, 177 + (c% AND 1)
      POKE offset% + 1, c% AND 15
      offset% = offset% + 2
    NEXT x%
  NEXT y%
  WAIT &H3DA, 8
LOOP UNTIL INKEY$ <> ""
CLS
horz% = 10
sx% = 30
sy% = 30
sz% = 40
Mode7Text sx%, sy%, sz%, horz%
END
SUB Mode7Text (sx%, sy%, sz%, horz%)
'256*126 = 32256
'((256*126)+4)\2 =16130
'256*8 =2048
'32256\2=16128
FOR i% = 0 TO 359
  RA! = i% * (3.141593 / 180)
  Lcos!(i%) = COS(RA!)
  Lsin!(i%) = SIN(RA!)
NEXT i%
  FOR i% = -1024 TO 1024
    Lsin1%(i%) = SIN(i% / (16)) * 32
    Lsin2%(i%) = SIN(i% / (32)) * 16
    Lsin3%(i%) = SIN(i% / (32)) * 32
  NEXT i%
  j! = 255 / 360 * 8
  k! = 255 / 360 * 8
  l! = 255 / 360 * 16
  FOR i% = 0 TO 255
    m% = INT(a!)
    n% = INT(b!)
    o% = INT(c!)
    r% = 63 * ABS(SIN(m% * PI / 180))
    g% = 63 * ABS(SIN(n% * PI / 180))
    b% = 63 * ABS(SIN(o% * PI / 180))
    a! = a! + j!
    b! = b! + k!
    c! = c! + l!
    OUT &H3C8, i%
    OUT &H3C9, r%
    OUT &H3C9, g%
    OUT &H3C9, b%
  NEXT
SpaceZ! = sz%
ScaleY! = sy%
ScaleX! = sx%
Horizon% = horz%
countdir% = 1
counter% = 50
t# = TIMER
DO
  F& = (F& + 1) AND &H7FFFFFFF
  counter% = (counter% + countdir%)
  IF counter% < 2 THEN
    countdir% = -countdir%
  ELSEIF counter% > 700 THEN
    countdir% = -countdir%
  END IF
  pd% = (pd% + 1) AND 1023
  ci% = (ci% + 1) AND (3)
  px% = SIN(ci% / counter%) * 4
  py% = COS(ci% / counter%) * 8
  Angle = (Angle + 1) MOD 359
  xv! = Lcos!(Angle)
  yv! = Lsin!(Angle)
  offset% = (80 * 4)
  FOR ya% = 4 TO 50
      Distance! = (SpaceZ! * ScaleY!) / (ya% + Horizon%)
      HorizScale! = (Distance! / ScaleX!)
      LineDX! = (-yv! * HorizScale!)
      LineDy! = (xv! * HorizScale!)
      SpaceX! = ((Distance! * xv!)) - (40 * LineDX!)
      SpaceY! = ((Distance! * yv!)) - (25 * LineDy!)
      ldx& = LineDX! * 1024
      ldy& = LineDy! * 1024
      sx& = SpaceX! * 1024
      sy& = SpaceY! * 1024
      pxysin% = Lsin3%(px% + py%)
  FOR xa% = 1 TO 80
      xx% = sx& \ 1024' + (pd%)
      yy% = sy& \ 1024' + (pd%)
      c% = Lsin1%(xx% + px%) + Lsin2%(yy% + py%) + pxysin%
      c% = Lsin2%(xx% - counter%) + Lsin3%(Lsin1%(yy% - counter%) - Lsin3%(xx% - counter% - c%))
      POKE offset%, 177 + (c% AND 1)
      POKE offset% + 1, c% AND 15
      offset% = offset% + 2
      sx& = sx& + ldx&
      sy& = sy& + ldy&
  NEXT xa%
  NEXT ya%
  WAIT &H3DA, 8
LOOP UNTIL INKEY$ <> ""
END SUB
Exe in attachment.....
-
Man, the colors sux but the code is cool :) :cheers:
-
The colours are probably like that because of the screen mode.
Nice one Rel :)
-
The floor mapper looks really cool! The plasma goes a bit too fast for the char resolution. Nice colors!
So,. is ANSI also accepted on the competition? Normally, ASCII means monochrome characters and ANSI is the VGA chars with colors. At the beginning by reading that the compo is ASCII I thought I should be restricted to the ASCII mode, but if I can also do something in ANSI then cool! There is a diferrence between ASCII and ANSI. Maybe you can refer that ANSI is also allowed to the compo thread so that we know?
-
Yes, by all means use ansi.
The theme of the comp is to create effects from characters, whether they are monochrome or if they use any screen palette, whether they just use the standard ascii set or any extended characters is cool, just have at it and see what you can do!
-
Ok, cool! That's fine for me..
Actually, I know some people from Pouet who would start bitching like hell about the diferrence of ASCII and ANSI ;)
-
So do I :)
Gladly we don't have too much bitching here, just lots of happy coding!
I've seen previews of the winners banners that Wham is drawing for this comp and they look great btw!
-
It's pretty quick is that. Is the Plasma the texture used on the floormapper, as it was so fast I may of missed the 2 if they were seperate.
Welldone dude,
Clyde.
-
It's pretty quick is that. Is the Plasma the texture used on the floormapper, as it was so fast I may of missed the 2 if they were seperate.
Welldone dude,
Clyde.
Nope, the floormapper gets textured "real-time". Calculate the pixel then the texel and plot. :*)
-
Nice one Relsoft :)
Running the exe on my computer was a bit jumpy :( :whack: my crappy computer
-
I am afriad I dont really see a plasma or a floormapper, it just looks like random colored squares with a very rare at times look as if there trying to make a pattern like a plasma, guess it could be running to fast on my setup ???
-
I am afriad I dont really see a plasma or a floormapper, it just looks like random colored squares with a very rare at times look as if there trying to make a pattern like a plasma, guess it could be running to fast on my setup ???
Download the latest attachment in the first post and see if it is still fast. :*)
-
I can see a bit more that it is like a plasma shape at times but it's still seems way to fast, think the color restriction is a bit of a problem making it seem worse than it probably is.
-
Do you know what is really cool about this? It's that it's in proper text mode and the effect still runs while you are moving the window. Sure it runs really fast here too but I can still see what it is, perhaps it may run better on other systems with a smaller sine addition?
A question Rel, is there any way of compiling a fb program so that there is no dos window? :)
-
Yeah use in the compiler options in FB or after your programs name if your using the command prompt. -s gui ( switch graphic user interface )
-
Cool, got it to work from the command line, thanks Clyde sorry to topic hijack Rel.
-
Oh, and don't forget to press space or anything. Yes there are two parts and I would press escape in the plasma part if I hadn't read here there is a floor part too.
-
You guys are running this in a window?
Press ALT+Enter when theprog runs ;*)
-
It makes all the difference. I must admit that I was running this in windowed mode.
-
Bump
Press ALT+ENTER to see it in full screen.
-
Too subtle ;)
PRESS ALT+ENTER TO SEE IT IN FULL SCREEN!
-
LOL!
-
I didnt realize about pressing space either to see two different effects ( maybe in the future, add a readme or put a few details on any keys )
I quite like your Voxel Plasma thang Relsoft Dude.
Nice,
Clyde.
-
Nice one Rel :cheers: