Jump to content
Purzel

How do I set a camera straight downwards or tilt it a few degrees?

Recommended Posts

Hi I´ve

tried around a lot, but I dont get a camera straight downwards looking like a satellite.
 And I want to tilt another camera about 20-30° downwards, so I cant put the camera up in an edge of room and have a view without seeing the ceiling/roof.

But as a goodie I have a moving camera sweeping across the room.
( this is the code for the moving camera, which I want to get a little tilted downwards:)

 

monitor2 setObjectTexture [0, "#(argb,512,512,1)r2t(_SecCamTgt,1)"];
_SecCam = "camera" camCreate [5632.15,10196.7,4]; 
_SecCam setDir 236;
_SecCam camSetFov 1;
_SecCam cameraEffect ["Internal", "Back", "_SecCamTgt"];
"Seccamtg" setPiPEffect [0];
while {alive waffe} do {
_winkel = 45;						 		        // total sweeping angle
_SecCam setDir (getDir _SecCam - (_winkel / 2));	   // Set camera angle to the left at the beginning
// while {alive _SecCam} do {
	// Cam sweeping right
	for [{_i=0}, {_i<_winkel}, {_i=_i+1}] do
	{
		_SecCam setDir (getDir _SecCam + 1);
		sleep 0.01;
	};
	// Short Stop
	sleep 3;
	// Cam sweeping left
	for [{_i=0}, {_i<_winkel}, {_i=_i+1}] do
	{
		_SecCam setDir (getDir _SecCam - 1);
		sleep 0.01;
	};
	// Short stop
	sleep 3;
};
// If "waffe" is not alive, the camera-transmission ends and a "connection-lost"-screen is shown instead
//"_SecCamTgt" setPiPEffect [3,1,1,0.4,0,[0,0,0,0],[1,1,1,0],[1,1,1,1]];   // this would set the picture to a greyscaled picture
_SecCam cameraEffect ["terminate", "back"];
camDestroy _SecCam;
monitor2 setObjectTexture [0, "pictures\connectionlost.paa"];


"SetVectorDirAndUp" seems not to work in combination with "setDir", does anyone has another workaround?
And how do i setup a static downlooking camera?

Thanks for your help!
 

Share this post


Link to post
Share on other sites

If you set your cam down with setVectorDirAndUp [[0,0,-1],[0,1,0]]; It will look down however the setdir will not work since it rotates on itself, you will have to use setVectordirAndUp again to rotate the view. However you'd be better off having the camera following an invisible target (or a set of position arrays) with camPrepareTarget & camSetTarget

Share this post


Link to post
Share on other sites

[_SatCam, -90, 0] call BIS_fnc_setPitchBank;

 

is working for the satellite, but not at the sweeping security-cam

(-33 instead of -90 in the above code)

Share this post


Link to post
Share on other sites
9 hours ago, Purzel said:

[_SatCam, -90, 0] call BIS_fnc_setPitchBank;

 

is working for the satellite, but not at the sweeping security-cam

(-33 instead of -90 in the above code)

 

It's probably being overridden by something, show the updated code.

Share this post


Link to post
Share on other sites

Couldn't you just put down an invisible helipad (or any object really) in the center of the room and use camSetTarget to force the camera to look at it? That's what I've done in the past to get camera shots. Seems like it might save you a lot of headaches.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×