Liberty BASIC Community Forum
« 'Magic Eye' 3D images »

Welcome Guest. Please Login or Register.
Jun 25th, 2017, 05:18am


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: 'Magic Eye' 3D images  (Read 420 times)
tenochtitlanuk
Moderator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1154
xx 'Magic Eye' 3D images
« Thread started on: Feb 4th, 2016, 1:25pm »

The person named in my previous post has not replied, so presumably couldn't see their name in the image. Can you?
View the image at full size, and try to look THROUGH your screen, allowing your eyes to de-focus.
User Image
I wonder how many can see the depth in THIS image- you'll see my favourite dog at a new level..
User Image
User IP Logged

Chris Iverson
Administrator
ImageImageImageImageImage


member is offline

Avatar

20% Cooler


Homepage PM

Gender: Male
Posts: 2268
xx Re: 'Magic Eye' 3D images
« Reply #1 on: Feb 4th, 2016, 1:30pm »

I can see them both. I think he's been busy lately.
User IP Logged

"Do you believe in destiny?" - Pyrrha Nikos, RWBY
"With what wish will your Soul Gem shine?" - Kyubey, Puella Magi Madoka Magica
Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5314
xx Re: 'Magic Eye' 3D images
« Reply #2 on: Feb 4th, 2016, 1:52pm »

I can clearly see CARL and I can see great depth of focus in the second image but it is just straight bands, not sure if I am missing anything.
User IP Logged

tenochtitlanuk
Moderator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1154
xx Re: 'Magic Eye' 3D images
« Reply #3 on: Feb 4th, 2016, 3:17pm »

Well done, both! Surprising (?) how frustrated those who don't see the depth get, to the extent of insisting it doesn't exist and is just a mass hypnosis or mass hysteria conspiracy!
Yup, Rod, the dogs come in rows at different depths. Some people find this easier to see. And it distinguishes 'cross-eyed' viewers from 'normal'- they disagree on which rows are nearest/furthest.
I'll add the dog code to my site soon. At present I resize the dogs manually ( in GIMP) but will probably add ImageMagick code to do it automatically....

I for one have been glad to see Carl around more, recently!
User IP Logged

bluatigro
Guru
ImageImageImageImageImage


member is offline

Avatar

cxiu diversas el tio respondas cxiu samvaloras [ thats esperanto for : we are al different therefore we are al equal ]


PM

Gender: Male
Posts: 889
xx Re: 'Magic Eye' 3D images
« Reply #4 on: Feb 5th, 2016, 06:49am »


due to my albinism
i m unable to see 3d

but i m intersested how to create this
and maybe even animation ?
or is the last not visable ?

User IP Logged

basic's : C64 Simons C128 Amiga Amos quick4.5 Visual5 Visual6 Visual2005 Visual2008 just and last but not least liberty
tenochtitlanuk
Moderator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1154
xx Re: 'Magic Eye' 3D images
« Reply #5 on: Feb 5th, 2016, 1:36pm »

There's a zip file which includes code and three images to play with. Random Dot ( SIRDS) stereograms are on my site already. I particularly enjoyed using the image of 'our' Queen...

Thanks to RR for pointing out the scaling can be done without calling an external program.

Bluatigro- I hadn't thought of trying animation. May have a play sometime. I knew about your vision problems- you are a great example of what can be achieved by determination against handicaps.
User IP Logged

tenochtitlanuk
Moderator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1154
xx Re: 'Magic Eye' 3D images
« Reply #6 on: Feb 6th, 2016, 06:48am »

There's an excellent tutorial at Wikipedia
It includes an animated example, but I find it tiring and rather difficult to watch.
User IP Logged

tenochtitlanuk
Moderator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1154
xx Re: 'Magic Eye' 3D images
« Reply #7 on: Feb 6th, 2016, 3:50pm »

Plato's Cave roof with added LB flares... easiest viewed at full size.
User Image
User IP Logged

bluatigro
Guru
ImageImageImageImageImage


member is offline

Avatar

cxiu diversas el tio respondas cxiu samvaloras [ thats esperanto for : we are al different therefore we are al equal ]


PM

Gender: Male
Posts: 889
xx Re: 'Magic Eye' 3D images
« Reply #8 on: Feb 7th, 2016, 08:07am »

first try at magic eye 3d

Code:
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
global winx , winy , mmx , eye , you
winx = WindowWidth
winy = WindowHeight
mmx = 925
you = 1000
eye = 70 ''eyedistance
dim dx( winy )
for i = 0 to winy
  dx( i ) = rnd(0) * eye
next i
nomainwin
in$ = str$( mmx )
prompt "Screen size X in mm =" ; in$
mmx = val( in$ )
in$ = str$( you )
prompt "Screen - you distance in mm =" ; in$
you = val( in$ )
open "3d eye test" for graphics as #m
  #m "trapclose [quit]"
  for y = 0 to winy
    x = dx( y )
    while x < winx
      #m "goto ";x;" ";y
      #m "down"
      #m "set ";x;" ";y
      #m "up"
      x = x + fx( fz( x , y ) )
    wend
  next y
wait
[quit]
  close #m
end
function fx( z )
''calculate offset of next point
''if z = 0 then point is on screen
  fx = ( you - z ) * eye * mmx / winx / you
end function
function fz( x , y )
  x = x - winx / 2
  y = y - winy / 2
  uit = 0
  if sqr( x^2 + y^2 ) < 300 then
    uit = -200
  end if
  fz = uit
end function
 
User IP Logged

basic's : C64 Simons C128 Amiga Amos quick4.5 Visual5 Visual6 Visual2005 Visual2008 just and last but not least liberty
bluatigro
Guru
ImageImageImageImageImage


member is offline

Avatar

cxiu diversas el tio respondas cxiu samvaloras [ thats esperanto for : we are al different therefore we are al equal ]


PM

Gender: Male
Posts: 889
xx Re: 'Magic Eye' 3D images
« Reply #9 on: Feb 7th, 2016, 09:08am »

update :
- now whit colors
Code:
WindowWidth = DisplayWidth / 2
WindowHeight = DisplayHeight / 2
global winx , winy , mmx , eye , you , pi
pi = atn( 1 ) * 4
winx = WindowWidth
winy = WindowHeight
mmx = 925
you = 1000
eye = 70 ''eyedistance
dim dx( winy )
for i = 0 to winy
  dx( i ) = rnd(0) * 360
next i
nomainwin
in$ = str$( mmx )
prompt "Screen size X in mm =" ; in$
mmx = val( in$ )
in$ = str$( you )
prompt "Screen - you distance in mm =" ; in$
you = val( in$ )
open "3d eye test" for graphics as #m
  #m "trapclose [quit]"
  for y = 0 to winy
    hoek = dx( y )
    for x = 0 to winx
      scan
      #m "color ";rainbow$(hoek)
      #m "goto ";x;" ";y
      #m "down"
      #m "set ";x;" ";y
      #m "up"
      hoek = hoek + 360 / fx( fz( x , y ) )
    next x
  next y
wait
[quit]
  close #m
end
function fx( z )
''calculate offset of next point
''if z = 0 then point is on screen
  fx = ( you - z ) * eye * mmx / winx / you
end function
function fz( x , y )
  x = x - winx / 2
  y = y - winy / 2
  uit = 0
  if sqr( x^2 + y^2 ) < winy / 4 then
    uit = -200
  end if
  fz = uit
end function
function rad( deg )
  rad = deg * pi / 180
end function
function rainbow$( deg )
  r = sin( rad( deg ) ) * 127 + 128
  g = sin( rad( deg + 120 ) ) * 127 + 128
  b = sin( rad( deg - 120 ) ) * 127 + 128
  rainbow$ = rgb$( r , g , b )
end function
function rgb$( r , g , b )
  r = int( r ) and 255
  g = int( g ) and 255
  b = int( b ) and 255
  rgb$ = str$( r ) ; " " ; g ; " " ; b
end function
 
User IP Logged

basic's : C64 Simons C128 Amiga Amos quick4.5 Visual5 Visual6 Visual2005 Visual2008 just and last but not least liberty
Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5314
xx Re: 'Magic Eye' 3D images
« Reply #10 on: Feb 7th, 2016, 09:31am »

I can clearly see the big circular hole in the middle of the first image but I am not getting anything from the color image, what am I supposed to see?
User IP Logged

bluatigro
Guru
ImageImageImageImageImage


member is offline

Avatar

cxiu diversas el tio respondas cxiu samvaloras [ thats esperanto for : we are al different therefore we are al equal ]


PM

Gender: Male
Posts: 889
xx Re: 'Magic Eye' 3D images
« Reply #11 on: Feb 9th, 2016, 06:14am »



@rod :
- both images are the same

i was aming at a floting filledcircle , not a hole
in both pictures
so aparently i did somthing wrong

update :
- i think i fond the error in point version
Code:
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
global winx , winy , mmx , eye , you
winx = WindowWidth
winy = WindowHeight
mmx = 350
you = 500
eye = 70 ''eyedistance
dim dx( winy )
for i = 0 to winy
  dx( i ) = rnd(0) * eye / mmx * winx
next i
nomainwin
in$ = str$( mmx )
prompt "Screen size X in mm =" ; in$
mmx = val( in$ )
in$ = str$( you )
prompt "Screen - you distance in mm =" ; in$
you = val( in$ )
open "3d eye test" for graphics as #m
  #m "trapclose [quit]"
  for y = 0 to winy
    x = dx( y )
    while x < winx
      #m "goto ";x;" ";y
      #m "down"
      #m "set ";x;" ";y
      #m "up"
      x = x + fx( fz( x , y ) )
    wend
  next y
wait
[quit]
  close #m
end
function fx( z )
''calculate offset of next point
''if z = 0 then point is on screen
  fx = ( you - z ) * eye * mmx / winx / you
end function
function fz( x , y )
  x = x - winx / 2
  y = y - winy / 2
  uit = 0
  if sqr( x^2 + y^2 ) < 300 then
    uit = -100
  end if
  fz = uit
end function
 
User IP Logged

basic's : C64 Simons C128 Amiga Amos quick4.5 Visual5 Visual6 Visual2005 Visual2008 just and last but not least liberty
Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5314
xx Re: 'Magic Eye' 3D images
« Reply #12 on: Feb 9th, 2016, 06:19am »

Your first try was better a very clear sunken circle. The latest code is very vague, there is a hint of a central circle but it does not look like a floating plate.
User IP Logged

cundo
Guru
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 620
xx Re: 'Magic Eye' 3D images
« Reply #13 on: Feb 12th, 2016, 10:04am »

I have tried to see something, but no luck for me. ;( I think I don't have my eyes perfectly aligned.
User IP Logged

cundo
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls