I've recently grabbed a polarized 3d monitor, so I was playing about seeing how easy it is or not to "split" the screen, apparently if you use TriDef you cant actually use something not supported... just had a quick play about with the idea (code attached) and it does look to be working.
I had a quick search but it didn't bring up any topics regarding this, has anyone tried it fully? any other quicker ideas? The timer says roughly 1-2 ms for this method.
Graphics3D 1920,1080,32,2
SetBuffer(BackBuffer())
Global split# = 0.25
Global aim# = 100
camerapiv = CreatePivot()
camera1 = CreateCamera(camerapiv)
camera2 = CreateCamera(camerapiv)
CameraViewport camera1,0,0,1920,540
CameraViewport camera2,0,540,1920,540
PositionEntity camera1,-split#,0,0
PositionEntity camera1, split#,0,0
ScaleEntity camera1,1,2,1
ScaleEntity camera2,1,2,1
cameraaim = CreatePivot(camerapiv)
MoveEntity cameraaim,0,0,aim#
PointEntity camera1,cameraaim
PointEntity camera2,cameraaim
light = CreateLight()
cube = CreateCube()
sphere = CreateSphere(25)
PositionEntity cube,-1,0,7.5
PositionEntity sphere,1,0,10
Global texture = CreateTexture(1920,1080,512+256+1,1)
Color 255,255,255
While Not KeyHit(1)
TurnEntity cube,1,.2,0
TurnEntity light,-1,.2,0
UpdateWorld
RenderWorld
timer = MilliSecs()
polarizerect()
Text 10,10,MilliSecs()-timer
Flip
Wend
Function polarizerect(lr=False)
CopyRect 0,0,1920,1080,0,0,BackBuffer(),TextureBuffer(texture)
For y = 0 To 540 Step 1
If lr=False
CopyRect 0,y,1920,1,0,y*2,TextureBuffer(texture),BackBuffer()
CopyRect 0,540+y,1920,1,0,(y*2)+1,TextureBuffer(texture),BackBuffer()
Else
CopyRect 0,y,1920,1,0,(y*2)+1,TextureBuffer(texture),BackBuffer()
CopyRect 0,540+y,1920,1,0,y*2,TextureBuffer(texture),BackBuffer()
EndIf
Next
End Function
ClearWorld
EndGraphics
End
|