Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, VoroneTZ), 1,507 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
Split screen? #436617
01/30/14 07:12
01/30/14 07:12
Joined: Jan 2012
Posts: 36
T
themuzikman Offline OP
Newbie
themuzikman  Offline OP
Newbie
T

Joined: Jan 2012
Posts: 36
Hello,

I was wondering if anyone could tell me how to make a split screen (side by side) with two cameras that are right next to each other.

I'm trying to experiment with some stereoscopic (3D) videos and so I need two cameras side by side and I need the right camera to show up on the left side of the screen and the left camera to display on the right side.



Sounds simple enough but I'm so out of the loop, it's been over 10 years since I've done any programming in 3DGS wink

I would like the cameras to be attached to the player, so that they are in a fixed position. As the player walks around, the two cameras are still in the same relative position.

Thanks in advance!
-Dan

Re: Split screen? [Re: themuzikman] #436618
01/30/14 07:16
01/30/14 07:16
Joined: Jan 2012
Posts: 36
T
themuzikman Offline OP
Newbie
themuzikman  Offline OP
Newbie
T

Joined: Jan 2012
Posts: 36
Also, here's some pictures I took last week while hiking. This is what I would like it to look like on the screen. Left camera is on the right, and vice versa. When you cross your eyes, or look at the pictures and "unfocus" your eyes, a new 3D picture will appear.






Re: Split screen? [Re: themuzikman] #436631
01/30/14 10:57
01/30/14 10:57
Joined: Mar 2010
Posts: 57
Germany, Niedersachsen
LemmyTheSlayer Offline
Junior Member
LemmyTheSlayer  Offline
Junior Member

Joined: Mar 2010
Posts: 57
Germany, Niedersachsen
what you need is a VIEW struct. take a look here:
http://conitec.net/beta/aview-name.htm


SCHLEIFE SCHLEIFE SCHLEIFE SCHLEIFE SCHLEIFE SCHLEIFE
Re: Split screen? [Re: LemmyTheSlayer] #436711
01/31/14 16:43
01/31/14 16:43
Joined: Jan 2012
Posts: 36
T
themuzikman Offline OP
Newbie
themuzikman  Offline OP
Newbie
T

Joined: Jan 2012
Posts: 36
Thank you for the response. I'm still unsure where to put that code or how to use it, though haha.

Re: Split screen? [Re: themuzikman] #436712
01/31/14 17:07
01/31/14 17:07
Joined: Mar 2010
Posts: 57
Germany, Niedersachsen
LemmyTheSlayer Offline
Junior Member
LemmyTheSlayer  Offline
Junior Member

Joined: Mar 2010
Posts: 57
Germany, Niedersachsen
this is how you could use it:

Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////

VIEW* camera2 = {
   flags = SHOW;
}


function main() {
   level_load(NULL);
   
   camera.size_x = screen_size.x/2 - 2;
   
   camera2.size_x = screen_size.x/2 - 2;
   camera2.pos_x = screen_size.x/2 + 2;
   
   camera.x = -65;
   camera.y = 42;
   camera.pan = -26;
   
   camera2.x = -64;
   camera2.y = -50;
   camera2.z = 50;
   camera2.pan = 42;
   camera2.tilt = -29;
   
   ENTITY* cube = ent_create(CUBE_MDL,nullvector,NULL);
   
   while(1) {
      cube.pan += 4*time_step;
      wait(1);
   }
}



SCHLEIFE SCHLEIFE SCHLEIFE SCHLEIFE SCHLEIFE SCHLEIFE
Re: Split screen? [Re: LemmyTheSlayer] #436713
01/31/14 17:25
01/31/14 17:25
Joined: Jan 2012
Posts: 36
T
themuzikman Offline OP
Newbie
themuzikman  Offline OP
Newbie
T

Joined: Jan 2012
Posts: 36
Awesome! Thank you! Now how can I get it to work as my main camera set up in a level instead of only displaying the cube?
And also to be set up as a flythrough or player camera, and so that both cameras move together.

Last edited by themuzikman; 01/31/14 17:36.
Re: Split screen? [Re: themuzikman] #436714
01/31/14 17:51
01/31/14 17:51
Joined: Jan 2012
Posts: 36
T
themuzikman Offline OP
Newbie
themuzikman  Offline OP
Newbie
T

Joined: Jan 2012
Posts: 36
Ok, nevermind I got it to load my level, but how do I attach these two cameras to the player so that they will both move with it?

Edit: Haha I can make the left camera follow the player, but the right camera is still stationary.

Last edited by themuzikman; 01/31/14 18:19.
Re: Split screen? [Re: themuzikman] #436717
01/31/14 18:46
01/31/14 18:46
Joined: Mar 2010
Posts: 57
Germany, Niedersachsen
LemmyTheSlayer Offline
Junior Member
LemmyTheSlayer  Offline
Junior Member

Joined: Mar 2010
Posts: 57
Germany, Niedersachsen
Code:
VECTOR* offset1 = {...};
VECTOR* offset2 = {...};

...

vec_set(camera.x,player.x);
vec_add(camera.x,offset1);
vec_set(camera2.x,player.x);
vec_add(camera2.x,offset2);


you have to choose offset1 and offset2 accordingly, of course


SCHLEIFE SCHLEIFE SCHLEIFE SCHLEIFE SCHLEIFE SCHLEIFE
Re: Split screen? [Re: LemmyTheSlayer] #436719
01/31/14 19:05
01/31/14 19:05
Joined: Jan 2012
Posts: 36
T
themuzikman Offline OP
Newbie
themuzikman  Offline OP
Newbie
T

Joined: Jan 2012
Posts: 36
Thanks! What would I typically put in the brackets, though?

Re: Split screen? [Re: themuzikman] #436720
01/31/14 19:17
01/31/14 19:17
Joined: Mar 2010
Posts: 57
Germany, Niedersachsen
LemmyTheSlayer Offline
Junior Member
LemmyTheSlayer  Offline
Junior Member

Joined: Mar 2010
Posts: 57
Germany, Niedersachsen
the offsets are vectors that point from the player to the cameras.
something like that should be okay in the beginning:
Code:
VECTOR* offset1 = {0,-distance,0};
VECTOR* offset2 = {0, distance,0};


of course you have to find a decent value for distance that fits well with your pictures.


SCHLEIFE SCHLEIFE SCHLEIFE SCHLEIFE SCHLEIFE SCHLEIFE
Page 1 of 3 1 2 3

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1