Author Topic: Twisting Sinusscrollers - How is this done  (Read 4489 times)

0 Members and 1 Guest are viewing this topic.

Offline DeXtr0

  • C= 64
  • **
  • Posts: 79
  • Karma: 4
  • Proud member of dAWN
    • View Profile
    • dAWN Creations
Twisting Sinusscrollers - How is this done
« on: September 11, 2007 »
Hey guys,

I was watching some intro's the last couple of days and I noticed the remakes of those neat Vision Factory intro's.
A couple of there intro's have those nice twisting/curling (or how to call it) sinusscrollers effect.

What I mean are those sinusscrollers which look like a "tube" so you see the backside of the characters aswell...


Does anybody know the technique behind it ?

All help is welcome since I got no clue  ???

Thanks a lot,
DeXtr0


Offline Voltage

  • Professor
  • Pentium
  • *****
  • Posts: 857
  • Karma: 53
    • View Profile
Re: Twisting Sinusscrollers - How is this done
« Reply #1 on: September 12, 2007 »
Heres some Freebasic code to do what I think you are after. 

For each x position
  Calculate y1 and y2 positions (roughly 90 degress apart (see +1.3 below))
  Do some lighting
  Draw lines (here you would texture something interesting instead of just drawing a plain line)

Code: [Select]
Screen 19,32

Dim As Integer x,y1,y2,c

For x=0 To 799
y1=200+Sin(x/30.0)*20
y2=200+Sin(x/30.0+1.3)*20

If y1>y2 Then
c=RGB(30,30,30)
Else
c=RGB((y2-y1)*7+50,10,50)
End if

Line (x,y1)-(x,y2),c
Next

SLEEP
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2756
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Twisting Sinusscrollers - How is this done
« Reply #2 on: September 12, 2007 »
If you are using some 3D api (OGL or DX9), you can scroll an texture (with alpha blend) on a simple cylinder  :) , something like this one   ;)

Challenge Trophies Won:

Offline DeXtr0

  • C= 64
  • **
  • Posts: 79
  • Karma: 4
  • Proud member of dAWN
    • View Profile
    • dAWN Creations
Re: Twisting Sinusscrollers - How is this done
« Reply #3 on: September 12, 2007 »
Wow guys you are grreat !

Never thought the answer was getting here that fast...

I'm coding in PureBasic so I'll have to check how I have to do it there but i'm definately going to try both ways. (after my holiday, I leave in 2 days)  :D

1000x Thanks guys,
DeXtr0

P.S. Scrolling a texture, never thought of that .... for doing a scroller. I'll try very very soon...

Offline p01

  • Atari ST
  • ***
  • Posts: 158
  • Karma: 51
    • View Profile
    • www.p01.org

Offline DeXtr0

  • C= 64
  • **
  • Posts: 79
  • Karma: 4
  • Proud member of dAWN
    • View Profile
    • dAWN Creations
Re: Twisting Sinusscrollers - How is this done
« Reply #5 on: September 12, 2007 »
Wow p01, cool tip !

Thanks a lot,
DeXtr0

Offline va!n

  • Pentium
  • *****
  • Posts: 1432
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: Twisting Sinusscrollers - How is this done
« Reply #6 on: September 12, 2007 »
Here is a PB version of the source:

Code: [Select]
InitSprite()
OpenScreen(800,600,32,"Test")

Repeat

  For x=0 To 799
  y1 = 200+Sin(x/30.0)*20
  y2 = 200+Sin(x/30.0+1.3)*20
 
  If y1>y2 
  c = RGB(30,30,30)
  Else
  c = RGB((y2-y1)*7+50,10,50)
  EndIf
 
    StartDrawing(ScreenOutput())
    LineXY (x,y1,x,y2,c)
  StopDrawing()
  Next

  FlipBuffers()
Until GetAsyncKeyState_(#VK_ESCAPE)
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline DeXtr0

  • C= 64
  • **
  • Posts: 79
  • Karma: 4
  • Proud member of dAWN
    • View Profile
    • dAWN Creations
Re: Twisting Sinusscrollers - How is this done
« Reply #7 on: September 12, 2007 »
Whohoo sweet VA!N :)

Thanks a lot ,really appreciate that..

.DeXtr0