stereocam how to do it ?
Blitz3D Forums/Blitz3D Programming/stereocam how to do it ?
| ||
Hello Please help as follows: in Blitz3D I create two cameras that I want to join with you to the "rigid", I tried to do this, but as I rotate them at the same time that they rotate around its own axis, and I want to do this so that the spin around the center of the distance between them. I'm waiting for help Blicek |
| ||
Create a pivot and parent both cameras to the pivot. When you want to move the cameras, move the pivot instad. |
| ||
OK but I know-please ready example ( code ) blicek |
| ||
|
| ||
Thanks much Tom... So with the following changes- and by opening up my Google Cardboard VR and placing it on my 24" LCD monitor screen over the smaller window area, then looking thru the lenses I can get a pretty convincing 3D display. So the problem using the Google Cardboard on a LCD monitor is that the pixels are very much larger than on a modern cellphone. The spacing is pretty good but the image is not as "hi-res". If the manufacturers would make very high resolution cellphone size monitors with connections for HDMI,DVI or VGA we would be in business for Blitz3D VR and give Oculus some competition!! Great work! Many years ago I did something similar with B3D: 2 cams 2 windows and using a cardboard separator I was able to get a 3d VR preview by placing my eyes about 6 inches from the screen- (The cardboard centered on the horizontal divide of the 2 windows). Graphics3D 400,300,32,2 SetBuffer BackBuffer() ;create something to look at Local box = CreateCube() For i = 1 To 100 PositionEntity CopyEntity(box),Rand(-100,100),Rand(-100,100),Rand(-100,100) Next Global xwidth=400 Global ywidth=300 ;add a bit of light to the scene Local light = CreateLight() RotateEntity light,45,45,45 ;create the pivot for the camera Local CameraPivot = CreatePivot() ;add the cameras to the pivot Local Cam1 = CreateCamera(CameraPivot) Local Cam2 = CreateCamera(CameraPivot) ;move the cameras relative to the pivot PositionEntity Cam1,-.3,0,0 ;The distance will depend on the unit size and desired PositionEntity Cam2,.3,0,0 ; Spacial effect. ;Now we need to tell the cameras where to draw on the screen CameraViewport Cam2,0,0,xwidth/2,ywidth CameraViewport Cam1,xwidth/2,0,xwidth/2,ywidth ;Now lets move the entire camera structure back a bit so the cube is in view PositionEntity CameraPivot,0,0,-7 While Not KeyHit(1) RotateMesh box,1,2,3 ;spin the cube RenderWorld Flip ;move the camera around Cursor keys to turn and W/S to move forward, back If KeyDown(17) Then MoveEntity CameraPivot,0,0,.2 If KeyDown(31) Then MoveEntity CameraPivot,0,0,-.2 If KeyDown(200) Then TurnEntity CameraPivot,1,0,0 If KeyDown(208) Then TurnEntity CameraPivot,-1,0,0 If KeyDown(205) Then TurnEntity CameraPivot,0,-1,0 If KeyDown(203) Then TurnEntity CameraPivot,0,1,0 Wend |
| ||
OK OK ! Just here I meant. Big thanks ! blicek |