1 registered members (AndrewAMD),
1,643
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Split screen?
#436617
01/30/14 07:12
01/30/14 07:12
|
Joined: Jan 2012
Posts: 36
themuzikman
OP
Newbie
|
OP
Newbie
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 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]
#436712
01/31/14 17:07
01/31/14 17:07
|
Joined: Mar 2010
Posts: 57 Germany, Niedersachsen
LemmyTheSlayer
Junior Member
|
Junior Member
Joined: Mar 2010
Posts: 57
Germany, Niedersachsen
|
this is how you could use it:
///////////////////////////////
#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
themuzikman
OP
Newbie
|
OP
Newbie
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
themuzikman
OP
Newbie
|
OP
Newbie
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
Junior Member
|
Junior Member
Joined: Mar 2010
Posts: 57
Germany, Niedersachsen
|
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: themuzikman]
#436720
01/31/14 19:17
01/31/14 19:17
|
Joined: Mar 2010
Posts: 57 Germany, Niedersachsen
LemmyTheSlayer
Junior Member
|
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:
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
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|