Home   Help Search Login Register  

Author Topic: Camera following a vehicle but targetting others  (Read 3254 times)

0 Members and 1 Guest are viewing this topic.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Camera following a vehicle but targetting others
« on: 17 Mar 2007, 18:21:44 »
Here is the problem:
A camera is attached to a vehicle, so it is setposed every very few fractions of seconds and commited really quick to keep with the vehicle while it is moving.
BUT, the camera should keep targeting other vehicles nearby and here comes the problem, the camera should "look" to a new targetted vehicle in no less than a second.

Example:
The camera is following you while traveling in a jeep (the camera represents your eyes), while the jeep moves (and the camera with it), the camera targets on several nearby destroyed vehicles, as if the jeep driver were looking at them, one after another while the jeep continues its advance.

Is there any trick to get that effect?

Offline Blanco

  • Former Staff
  • ****
Re: Camera following a vehicle but targetting others
« Reply #1 on: 17 Mar 2007, 20:22:11 »
Yes, logiccam can do this but I don't have a working examply for Arma. (yet)
You place the camera in the driverseat of a moving car if you want and follow vehicles along the road.
But you can't change the cameraposition or cameratarget in smooth transition., it's instant.
 
Search or search or search before you ask.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Camera following a vehicle but targetting others
« Reply #2 on: 17 Mar 2007, 20:31:59 »
But you can't change the cameraposition or cameratarget in smooth transition., it's instant.

That is exactly the problem to solve  ;)

Offline Blanco

  • Former Staff
  • ****
Re: Camera following a vehicle but targetting others
« Reply #3 on: 17 Mar 2007, 20:34:58 »
I'm sure it can be done but I'm not good in math...

The main idea in logiccam is to create 2 gamelogics in a script.
One logic for the cameraposition and the other one for the cameratarget.
These gamelogics are setpossed in a constant loop in a relative position from the vehicle or unit.

Getting the exact relative position regarding the vehicle's direction is easy in Arma with the modeltoworld command. No need anymore for cos & sin stuff.
The only thing I don't know is how I can move smoothly from one position to another and how do I keep of control of the speed of that transition. It's a constant loop you know, how much is the increment for each cycle?
Search or search or search before you ask.

Offline Brandon

  • Members
  • *
Re: Camera following a vehicle but targetting others
« Reply #4 on: 18 Mar 2007, 08:47:31 »
:( I want to know what you guys are talking about.... But eveythings ether:

A. Poorly translated.
B. In a different language other than English.
C. Non-Existent.
D. Spread out over the far reaches of the universe, impossible to locate.

I've made many films, but never understood all these commands and fancy terms. I've tried in OFP but nothing came of it..

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Camera following a vehicle but targetting others
« Reply #5 on: 18 Mar 2007, 10:52:03 »
The camera is following you while traveling in a jeep (the camera represents your eyes), while the jeep moves (and the camera with it), the camera targets on several nearby destroyed vehicles, as if the jeep driver were looking at them, one after another while the jeep continues its advance.

Is there any trick to get that effect?
See attached example. Not by all means perfect but should give the general idea...

The trick is to use two scripts for the same camera, other does the setPossing and other does the panning movements.


The camera still does some erratic moves if you set the commit values too long in the movement script, the camera always tries to look at the driving vehicle before looking at the target..  But that happens only when the camera turns back looking forward before turning to another target..
Also in the end the camera turns facing back and I don't know why that happens..  :dunno:

In the example the camera is positioned above the jeep because some of the wrecks are invisible through the jeep windows..  ::) (yay for old OFP bugs still there..)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Camera following a vehicle but targetting others
« Reply #6 on: 18 Mar 2007, 10:58:06 »
Brandon, the following is an example:

The camera is moving with a vehicle and, at the same time, the camera is targeting another vehicle to the left of the camera's vehicle. Then you want the camera to target a differet vehicle to the right of the camera's vehicle, of course, while the camera's vehicle keep moving.

So, you need to setpos the camera continuously in camera's vehicle position and commit this change really quick. This commit is continuous and will commit not only changes in camera's position, but also anyother camera factor you change, for example, the camera's target (to look at another vehicle).

Blanco, there is a way with a moving gamelogic, but certainly not the "desired" way. The camera targets a gamelogic, and then you move (displace) smoothly that gamelogic from one vehicle to another. But then the displacement speed should be accurate enough to provide a pretty smooth angular displacement (from the point of view of the moving vehicle) to avoid camera "jumps". And the displacement should be 3D, not only 2D, your next target may be a flying chopper, then a burning tank, then an incomming missile and so on.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Camera following a vehicle but targetting others
« Reply #7 on: 18 Mar 2007, 11:04:56 »
That is the desired effect h-  :good:
And that is the effect I dont have with a single script  :blink:

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Camera following a vehicle but targetting others
« Reply #8 on: 18 Mar 2007, 11:08:42 »
Mandoble, you should know better not to double post ;)

EDIT:
Quote
And that is the effect I dont have with a single script
Would be impossible to do with single script unless BIS would add a command like cam camAttachToVehicle vehicle

And while at it why not add cam camTargetAt [target,period], the period would be the time the target would be 'looked at' before turning back to facing the direction prior to issuing that command..
Would be much easier to make such scripts..
« Last Edit: 18 Mar 2007, 11:42:09 by h- »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Camera following a vehicle but targetting others
« Reply #9 on: 18 Mar 2007, 12:16:43 »
Well, it may be done with a single script. All the trick was in the camprepare and camset commands. To move the camera use camprepare commands, for targets camset commands. They seem to not interfere, camcommitprepared and camcommit

So you may camcommitPrepared 0 for camPreparePos and camcommit 1 for camsetTargets, all in the same script with pretty good results.

BTW, it seems we posted at the same time in the previous "doublepost" ;)

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Camera following a vehicle but targetting others
« Reply #10 on: 18 Mar 2007, 12:26:54 »
Quote
They seem to not interfere, camcommitprepared and camcommit
Interesting..
I was actually about to test that because I noticed huge differences in how they commands with prepare act, but you saved me the trouble :)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.