Jump to content
code34

OO_CAMERA - oriented object camera

Recommended Posts

Object Oriented CAMERA
Lastest version: 0.1 by Code34

 

Like to Donate ? Donate with paypal



Download: https://www.dropbox.com/s/3cf9k7p2h0hboqk/oo_camera.altis.zip?dl=0
GitHub: https://github.com/code34/oo_camera.altis
Reference: http://forums.bistudio.com/showthread.php?167980-Object-Oriented-SQF-Scripting-and-Compiling






Description
OO CAMERA is a class (object oriented) that permits to create dynamic windows box containing a camera view. This class uses Object Oriented SQF scripting of Naught and doesn't require any addons, or any insertions in description.ext

Features:
  • create/destroy a camera in a dynamic windows box (r2w)
  • create/destroy a camera as a textured object (r2o)
  • Attach / Detach this cam to an object
  • Different camera view preset as goprocam :)

Licence:
Under Gpl, you can share, modify, distribute this script but don't remove the licence and the name of the original author

Documentation:

/*
Author: code34 nicolas_boiteux@yahoo.fr
Copyright (C) 2014-2015 Nicolas BOITEUX

CLASS OO_CAMERA - Dynamic windows box - camera view

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/




/*
Function: _cam = ["new"] call OO_CAMERA;
Create a new camera object

Parameters:
none

*/


/*
Function: = [preset, object] spawn _cam;
Use a preset camera

Parameters:
preset - string can be : "backcamera", "topCamera", "goProCamera", "uavCamera"

*/

/*
Function: = ["attachTo", array] call _cam;
Attach a camere to an object

Parameters:
array containing:
- object - object to attach the camera
- array - position of the attachment point
- string - name of the attachment point (optionnal)

*/

/*
Function: = ["detach", []] call _cam;
Detach the camera

Parameters:
empty array - will be fix

*/

/*
Function: = ["r2w", array] call _cam;
Create a dynamic windows containg the camera view

Parameters:
array containing:
- left x position
- left y position
- width of windows
- height of windows

*/

/*
Function: = ["r2o", object] call _cam;
Create a dynamic surface instead of texture containg the camera view

Parameters:
object wich will be use to print the camera view

*/

Readme:
/*
Author: code34 nicolas_boiteux@yahoo.fr
Copyright (C) 2014-2015 Nicolas BOITEUX

CLASS OO_CAMERA - Pesistent Data World

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

Create a dynamic camer in a windows box / or textured object

Usage:
put the "oo_camera.sqf" and the "oop.h" files in your mission directory
put this code into your mission init.sqf
call compilefinal preprocessFileLineNumbers "oo_camera.sqf";

See example mission in directory: init.sqf

Licence:
You can share, modify, distribute this script but don't remove the licence and the name of the original author

logs:
0.1 - OO CAMERA - first release



Example - code of the video :)
call compilefinal preprocessFileLineNumbers "oo_camera.sqf";

sleep 4;

_cam = ["new", []] call OO_CAMERA;
["backCamera", player] spawn _cam;
sleep 1;
["r2w", [-0.4, 0.8,0.3,0.4]] call _cam;

_cam2 = ["new", []] call OO_CAMERA;
["topCamera", player] spawn _cam2;
["r2w", [0, 0.8,0.3,0.4]] call _cam2;

_cam3 = ["new", []] call OO_CAMERA;
["goProCamera", player] spawn _cam3;
["r2w", [0.4, 0.8,0.3,0.4]] call _cam3;

_cam4 = ["new", []] call OO_CAMERA;
["uavCamera", player] spawn _cam4;
["r2w", [0.8, 0.8,0.3,0.4]] call _cam4;

sleep 3;
["delete", _cam] call OO_CAMERA;

_cam5 = ["new", []] call OO_CAMERA;
["goProCamera", player] spawn _cam5;
["r2o", toto] call _cam5;
["setPipEffect", [2]] call _cam5;
Edited by code34
  • Like 2

Share this post


Link to post
Share on other sites
Guest

Thanks for informing us of the release :cool:

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means soon you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

this is a great idea, I can see this being useful for cctv on helos and the osprey. Will come in handy for landings!

is it possible to activate it using an action button and then de-activating it, so that it does not clutter the screen all the time?

Share this post


Link to post
Share on other sites

yes, as you can activate/desactivate/custom it during the game, when you want :)

Share this post


Link to post
Share on other sites
yes, as you can activate/desactivate/custom it during the game, when you want :)

thats cool. I'm not great at scripting but am I right in saying where you have player that would be the name of the helo??

Am i understanding this correctly??

_cam = ["new", []] call OO_CAMERA;

["backCamera", player] spawn _cam; --------------object

sleep 1;

["r2w", [-0.4, 0.8,0.3,0.4]] call _cam;--------------camera positioning

Share this post


Link to post
Share on other sites

you can use it like this :)

["backCamera", player] spawn _cam; <-------------- backcamera is the name of preset, you can also use: "topCamera" or "goProCamera" instead, player is the object

presets are here only for examples demo :)

["r2w", [-0.4, 0.8,0.3,0.4]] call _cam; <--------------windows box position containing the camera view: [x pos, y pos, width, height]

If you want to custom your own camera with a define attach point, you can set it as this:

_cam = ["new", []] call OO_CAMERA

_array = [player,[0,1,0], "neck"]; <------------- array contains: object, position of the attachment point for this object, name of the attachment point according the attachment point of BIS (optional)

["attachTo", _array] spawn _cam;

---------- Post added at 23:49 ---------- Previous post was at 23:26 ----------

for more information, i just add a documentation part at the top of this thread :)

Edited by code34

Share this post


Link to post
Share on other sites

This is very awesome, great work. One of the few scripts that I actually want to download and look inside to see how you did things

Share this post


Link to post
Share on other sites

thats great stuff code34. I'm thinking of placing them on four maybe five points front hull left and right

http://upload.wikimedia.org/wikipedia/commons/e/eb/Royal_Navy_Merlin_Helicopter_MOD_45155806.jpg

and mid/rear left and right

this would give pilots great peripheral vision when landing and seeing troops de-bus.

Edited by SpookyGnu

Share this post


Link to post
Share on other sites

Ok :) give me a feedback, if some presets have to be add or other features introduce.

Share this post


Link to post
Share on other sites

All around view on the helos would be a great idea. Worth a release on its own that one.

Share this post


Link to post
Share on other sites
All around view on the helos would be a great idea. Worth a release on its own that one.

Thats what I was thinking an extension of this script relating to all vehicles would be great for emmersion.

Share this post


Link to post
Share on other sites

in Next release, all preset cam will be package in 1 function. Its important to remember cause its an alpha version. All functions and names are not yet definitevely fixed :-)

Edited by code34

Share this post


Link to post
Share on other sites

hi guy,

just fix the documentation of the first page of the thread where i saw somes errors

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

×