Reflection Effect
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Reflection Effect
Thanks for sharing that, RASHAD. It's another nice and compact implementation and it works well. My only concern with it is that the alpha drops off rather suddenly at the 2/3 mark. The dropoff is too sharp. If you look at the image in the first post, with the alpha reduced exponentially via the code from #NULL, you see that the alpha drops off quickly but yet still gradually. If you combine what you have with a variant of what #NULL supplied, we may have a viable alternative. Which we can always use. Please see what you can do.
BERESHEIT
Re: Reflection Effect
@NM I just added a new snippet to my previous post
Maybe we should use the vector lib all around
Will try it if I have some more time
Maybe we should use the vector lib all around
Will try it if I have some more time
Egypt my love
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Reflection Effect
In threads like this one I really miss my friend srod. He really brings math to the masses, a rare and remarkable talent.
BERESHEIT
Re: Reflection Effect
Agree not only for his talent with math but for more than that
But we still have Demivec ,Wilbert (Trond and I hope he is doing well)
But we still have Demivec ,Wilbert (Trond and I hope he is doing well)
Egypt my love
Re: Reflection Effect
THANK YOU EVERYONE!!!
Really great codes. Now to study and understand them.
TBH after testing them I feel that netmaestro's results are the best for my needs - I increased the exponent and get the perfect fade that looks like a drop reflection. Very nice!
I'm grateful to all of you for your help.



Really great codes. Now to study and understand them.
TBH after testing them I feel that netmaestro's results are the best for my needs - I increased the exponent and get the perfect fade that looks like a drop reflection. Very nice!

I'm grateful to all of you for your help.
Re: Reflection Effect
netmaestro wrote:... If only I'd spent less time dipping pigtails in the inkwell and paid more attention in school I might know some of this stuff.


We have the same disease.
- It was too lonely at the top.
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
- Kwai chang caine
- Always Here
- Posts: 5494
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Reflection Effect
Very very nice .....
And very useful because, never i have a table enough clean in my house, for can have really this effect
Thanks a lot at all for sharing

And very useful because, never i have a table enough clean in my house, for can have really this effect

Thanks a lot at all for sharing


Not a destination
Re: Reflection Effect
or maybe just the same type of teachers like mine who never showed maths actually can be funblueb wrote:netmaestro wrote:... If only I'd spent less time dipping pigtails in the inkwell and paid more attention in school I might know some of this stuff.![]()
![]()
We have the same disease.

Re: Reflection Effect
Looking a bit closer to the example in the first post, it looks like the reflection in the image is also blurred.
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
-
- Enthusiast
- Posts: 628
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: Reflection Effect
no any new simplest solution for mirror image? i need some horisontal or vertical or both case. without this fade out or mix colors.
Re: Reflection Effect
This Procedure from @RASHAD's & @Netmaestro sample code:
flips the image.
see the full code here http://www.purebasic.fr/english/viewtop ... 37#p501437 and
around line 59 comment out ;FreeImage(10) then use image 10
around line 63 ImageGadget(1,0,h,w,h,ImageID(10))
send an image to it and it will flip it.
if you want vertical (horizontal?) change this section:
[edit] added some code
Norm.
Code: Select all
Procedure Image_Rotate(Image,Angle)
nimgw = h*Sin(Angle*#PI/180)+w*Cos(Angle*#PI/180)
nimgh = w*Sin(Angle*#PI/180) + h*Cos(Angle*#PI/180)
temp=CreateImage(#PB_Any,nimgw,nimgh)
Dim p.Point(2)
p(0)\x=0
p(0)\y=nimgh
p(1)\x=nimgw
p(1)\y=nimgh
p(2)\x=0
p(2)\y=0
ImageDc = CreateCompatibleDC_(0)
SelectObject_(ImageDc,ImageID(Image))
dc=StartDrawing(ImageOutput(temp))
PlgBlt_(dc,@p(),ImageDc,0,0,w,h,0,0,0)
StopDrawing()
CopyImage(temp,image)
FreeImage(temp)
EndProcedure
see the full code here http://www.purebasic.fr/english/viewtop ... 37#p501437 and
around line 59 comment out ;FreeImage(10) then use image 10
around line 63 ImageGadget(1,0,h,w,h,ImageID(10))
send an image to it and it will flip it.
if you want vertical (horizontal?) change this section:
Code: Select all
; p(0)\x=0
; p(0)\y=nimgh
; p(1)\x=nimgw
; p(1)\y=nimgh
; p(2)\x=0
; p(2)\y=0
p(0)\x=nimgw
p(0)\y=0
p(1)\x=0
p(1)\y=0
p(2)\x=nimgw
p(2)\y=nimgh
Norm.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari