look how it works here:
http://www.easystereogrambuilder.com/howTheyWork.aspx
i am trying to imitate the procedure described in this page http://georgik.sinusgear.com/2013/07/12 ... photoshop/
to decode the stereogram, ie to know what the secret picture inside it since i never been able to see the hidden picture from long time ago, in fact i am depressed that i can't see the hidden image inside the stereograms.
if we apply the photoshop procedure using the shark.jpeg stereogram here http://www.vision3d.com/sghidden/shark.html
then this image can be seen

in concise we use 2 layers of the same stereogram, then we choose the blending option to be "Difference" we see the the layer 1 darkened, then we scroll the layer 1 to the right as in the above picture and at some point we see the shark picture
imitating that procedure in purebasic, i can see "ScrollMaterial" function, also "AddMaterialLayer" function, then we scroll the layer 1 slowly we can see very faint traces of the shark. in photoshop we used blending option as "Difference" when we add layer 1 (layer 0 is the original one) but in purebasic what could be in the place of Difference, i see these:
#PB_Material_Add
#PB_Material_Replace
#PB_Material_AlphaBlend
#PB_Material_Modulate
if some one can make the shark appears more thats great.
press left or right arrow to scroll the material layer 1 and try to capture the shark image. use different plans, lighting, etc... may be will work good
use this picture as stereogram http://www.vision3d.com/sghidden/images ... shark.jpeg save it to the same folder as the code. also try other stereograms pictures you may have better luck
Code: Select all
InitEngine3D()
InitSprite()
InitKeyboard()
Width = 800
Height = 600
If OpenWindow(0, 0, 0, Width, Height, "left/right arrow keys to scroll material layer 1",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
If OpenWindowedScreen(WindowID(0), 0, 0, Width, Height, 0, 0, 0)
Add3DArchive(".", #PB_3DArchive_FileSystem)
Add3DArchive(#PB_Compiler_Home+"\Examples\3D\Data\Textures",#PB_3DArchive_FileSystem)
Tex0=LoadTexture(#PB_Any,"shark.jpeg")
Mat=CreateMaterial(#PB_Any,TextureID(Tex0))
Mesh = CreatePlane(#PB_Any, 450, 315, 1, 1, 1, 1)
Entity=CreateEntity(#PB_Any, MeshID(Mesh), MaterialID(Mat),0,0,0)
RotateEntity(Entity, 90,0,180)
Tex1 = LoadTexture(#PB_Any, "shark.jpeg")
AddMaterialLayer(Mat, TextureID(Tex1), #PB_Material_Modulate)
;Mat = CreateMaterial(#PB_Any, TextureID(Tex))
MaterialBlendingMode(Mat, #PB_Material_AlphaBlend)
;MaterialCullingMode(Mat, #PB_Material_NoCulling )
;SetMaterialColor(Mat, #PB_Material_DiffuseColor, RGBA(255, 255, 255, 150))
Camera=CreateCamera(#PB_Any, 0,0,100,100)
MoveCamera(Camera, 0, 0, 740)
CameraLookAt(Camera, 0, 0, 0)
CameraBackColor(Camera, RGB(55, 55, 55))
Light=CreateLight(#PB_Any, RGB(255,255,255), 0,40,-60)
Rotate=1
;DisableMaterialLighting(mat, 1)
;SetMaterialColor(mat, #PB_Material_AmbientColor, RGB(200, 200, 200))
; SetMaterialColor(mat, #PB_Material_SpecularColor, RGB(255, 255, 255))
;ScrollMaterial(mat, 0.15, 0, 1)
Repeat
If ExamineKeyboard()
EndIf
If KeyboardPushed(#PB_Key_Right)
x.f+0.001
ScrollMaterial(Mat, x, 0, #PB_Material_Fixed , 1)
ElseIf KeyboardPushed(#PB_Key_Left)
x.f-0.001
ScrollMaterial(Mat, x, 0, #PB_Material_Fixed , 1)
EndIf
R.f=R+0.5
;RotateMaterial(Mat, R, #PB_Material_Fixed,1)
RenderWorld()
FlipBuffers()
Until WindowEvent() = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)
EndIf
EndIf
End