It is currently Sun Mar 07, 2021 10:48 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Rainbowaves
PostPosted: Thu Jan 07, 2021 4:23 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jan 04, 2011 6:21 pm
Posts: 131
I did this in 2006 but I haven't shown it much :
(Left Mouse Button to change)

Code:
; SPH(2006)
; PB4

InitSprite()
InitMouse()
InitKeyboard()

;SetPriorityClass_ ( GetCurrentProcess_ (), #IDLE_PRIORITY_CLASS )

If ExamineDesktops()
   dw.w=DesktopWidth(0)
   dh.w=DesktopHeight(0)
Else
   dw.w=1024
   dh.w=768
EndIf
dw2=dw/2
dh2=dh/2

dw1=dw/4
dw3=(dw/4)*3

OpenScreen(dw,dh,32,"")

;;;;;;;;;;;
;;;;;;;;;;;
autre:
rr1.f=Random(5)+Random(1000)/1000
rr2.f=Random(5)+Random(1000)/1000
vv1.f=Random(5)+Random(1000)/1000
vv2.f=Random(5)+Random(1000)/1000
bb1.f=Random(5)+Random(1000)/1000
bb2.f=Random(5)+Random(1000)/1000
or1.f=rr1
or2.f=rr2
ov1.f=vv1
ov2.f=vv2
ob1.f=bb1
ob2.f=bb2
cr1.f=0.001+Random(1000)/10000
cr2.f=0.001+Random(1000)/10000
cv1.f=0.001+Random(1000)/10000
cv2.f=0.001+Random(1000)/10000
cb1.f=0.001+Random(1000)/10000
cb2.f=0.001+Random(1000)/10000

a1.f=0.001+Random(1000)/35000
a2.f=0.002+Random(1000)/35000
a3.f=0.003+Random(1000)/35000
a4.f=0.001+Random(1000)/35000
a5.f=0.002+Random(1000)/35000
a6.f=0.003+Random(1000)/35000

;;;;;;;;;;;
Repeat ; Until xmouse<>xmouse2 Or ymouse<>ymouse2 Or KeyboardPushed(#PB_Key_All)

ExamineMouse()
xmouse=MouseDeltaX()/55 ; /x : x= sensibilité
ymouse=MouseDeltaY()/55 ; /x : x= sensibilité
;*****
ClearScreen(0)
StartDrawing(ScreenOutput())


;;;;;;;;;;;

For i=0 To dh-1
r1=63+Cos(rr1)*63
r2=63+Sin(rr2)*63
v1=63+Cos(vv1)*63
v2=63+Cos(vv2)*63
b1=63+Sin(bb1)*63
b2=63+Sin(bb2)*63

rr=r1+v1+b1
vv=r2+v2+b2

;LineXY(0,i,dw,i,RGB(b1+b2,r1+r2,v1+v2))
;LineXY(dw2,i,dw,i,RGB(b1+b2,r1+r2,v1+v2))

LineXY(dw2-rr,i,dw2+vv,i,RGB(r1+r2,v1+v2,b1+b2))

rr1+a1
rr2+a2
vv1+a3
vv2+a4
bb1+a5
bb2+a6
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  2



or1+cr1
rr1=or1
or2+cr2
rr2=or2
ov1+cv1
vv1=ov1
ov2+cv2
vv2=ob2
ob1+cb1
bb1=ob1
ob2+cb2
bb2=ob2
;;;;;;;;;;;
StopDrawing()
;*****
FlipBuffers()

If MouseButton(#PB_MouseButton_Left)<>0
Goto autre
EndIf

ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All)
End

_________________
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 5.73LTS - 32 bits


Top
 Profile  
Reply with quote  
 Post subject: Re: Rainbowaves
PostPosted: Thu Jan 07, 2021 4:57 pm 
Offline
Addict
Addict

Joined: Thu Apr 18, 2019 8:17 am
Posts: 1336
Nice! Reminds me a bit of the "Ray of Hope 2" demo on Amiga (watch from 1:20) -> https://youtu.be/EnPDc3bNPD4?t=80

How do you make it faster? I don't see any "Delay()" or such, so can it be made faster? Thanks.


Top
 Profile  
Reply with quote  
 Post subject: Re: Rainbowaves
PostPosted: Thu Jan 07, 2021 5:57 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jan 04, 2011 6:21 pm
Posts: 131
To speed up, some parts would have to be converted to ASM

_________________
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 5.73LTS - 32 bits


Top
 Profile  
Reply with quote  
 Post subject: Re: Rainbowaves
PostPosted: Fri Jan 08, 2021 5:56 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Nov 05, 2006 11:42 pm
Posts: 4876
Location: Lyon - France
Nice thing :D
Thanks for sharing 8)

_________________
ImageThe happiness is a road...
Not a destination


Top
 Profile  
Reply with quote  
 Post subject: Re: Rainbowaves
PostPosted: Fri Jan 08, 2021 7:50 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jun 24, 2006 3:29 am
Posts: 272
Location: Edinburgh, Scotland.
Im a total sucker for sinuses :)

Thx for sharing :)

_________________
Proud supporter of PB! * Musician * C64/6502 Freak


Top
 Profile  
Reply with quote  
 Post subject: Re: Rainbowaves
PostPosted: Fri Jan 08, 2021 7:54 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jun 24, 2006 3:29 am
Posts: 272
Location: Edinburgh, Scotland.
BarryG wrote:
How do you make it faster? I don't see any "Delay()" or such, so can it be made faster? Thanks.


Code:
;SetPriorityClass_ ( GetCurrentProcess_ (), #IDLE_PRIORITY_CLASS )


I guess this optional line is here in case it uses whole cpu :)))) (or core/thread, whatever)

also..... "AMIGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH!"... :)

EDIT: Also could be faster with a sinus table(s), maybe... probably

_________________
Proud supporter of PB! * Musician * C64/6502 Freak


Top
 Profile  
Reply with quote  
 Post subject: Re: Rainbowaves
PostPosted: Fri Jan 08, 2021 9:23 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Sep 11, 2016 2:17 pm
Posts: 842
Nice effect :>


Top
 Profile  
Reply with quote  
 Post subject: Re: Rainbowaves
PostPosted: Sat Jan 09, 2021 11:12 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Apr 25, 2003 5:10 pm
Posts: 557
Location: Doubs - France
Nice one (pas mal...)

_________________
A+
Denis


Top
 Profile  
Reply with quote  
 Post subject: Re: Rainbowaves
PostPosted: Sat Jan 09, 2021 5:51 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed May 27, 2020 12:26 pm
Posts: 290
oreopa wrote:
Im a total sucker for sinuses
I suppose Google Translate has a bug...

_________________
Thank you Google Search


Top
 Profile  
Reply with quote  
 Post subject: Re: Rainbowaves
PostPosted: Sat Jan 09, 2021 5:58 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 09, 2010 10:15 pm
Posts: 1756
I haven't viewed it, but I'm guessing he means sinusoidal shapes. That's how I read it, based on the title...


Top
 Profile  
Reply with quote  
 Post subject: Re: Rainbowaves
PostPosted: Sat Jan 09, 2021 7:48 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jun 24, 2006 3:29 am
Posts: 272
Location: Edinburgh, Scotland.
Olli wrote:
oreopa wrote:
Im a total sucker for sinuses
I suppose Google Translate has a bug...


Hehe. I guess it sounds pretty odd :) I'm no medical expert, but please, for heavens sake, DO NOT suck on other peoples sinuses... erm...

Indeed, I meant I like sinusoidal patterns. :D

PS: There should be a thread to collect the demo-like effects threads, there have been a few I recall... I might do it sometime

_________________
Proud supporter of PB! * Musician * C64/6502 Freak


Top
 Profile  
Reply with quote  
 Post subject: Re: Rainbowaves
PostPosted: Sat Jan 09, 2021 8:03 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed May 27, 2020 12:26 pm
Posts: 290
SPH published a very beautiful effect since near 3 years (2018?).

@SPH if you remember your algo about a water mirroring effect, using horizontal sinus also, do not hesitate to add a subject here, about it.

Translate (real) : il y a 2/3 ans, tu as posté un effet miroir horizontal qui ressemblait à la surface de l'eau. Si tu t'en souviens, tu devrais l'ajouter dans un nouveau sujet aussi.

_________________
Thank you Google Search


Top
 Profile  
Reply with quote  
 Post subject: Re: Rainbowaves
PostPosted: Sat Jan 09, 2021 8:22 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jan 04, 2011 6:21 pm
Posts: 131
Olli wrote:
SPH published a very beautiful effect since near 3 years (2018?).

@SPH if you remember your algo about a water mirroring effect, using horizontal sinus also, do not hesitate to add a subject here, about it.

Translate (real) : il y a 2/3 ans, tu as posté un effet miroir horizontal qui ressemblait à la surface de l'eau. Si tu t'en souviens, tu devrais l'ajouter dans un nouveau sujet aussi.


=> http://xmas.free.fr/demo_dog.zip

_________________
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 5.73LTS - 32 bits


Top
 Profile  
Reply with quote  
 Post subject: Re: Rainbowaves
PostPosted: Sat Jan 09, 2021 9:09 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed May 27, 2020 12:26 pm
Posts: 290
:shock:
I run away ! (ever with sinus for oreopa !)

_________________
Thank you Google Search


Top
 Profile  
Reply with quote  
 Post subject: Re: Rainbowaves
PostPosted: Mon Jan 11, 2021 9:40 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jun 24, 2006 3:29 am
Posts: 272
Location: Edinburgh, Scotland.
Olli wrote:
:shock:
I run away ! (ever with sinus for oreopa !)


lol :D

EDIT: unfortunately Bool breaks that code in newer pb.... (olli's code)

SPH wrote:


Nice one. :D

_________________
Proud supporter of PB! * Musician * C64/6502 Freak


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye