Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Camera offset

Author
Message
mikewhl
14
Years of Service
User Offline
Joined: 19th Jul 2010
Location: Columbus,Ohio
Posted: 26th Aug 2010 19:04
Hi all,
I am trying to make a player to target view. I cannot figure out how to offset the camera from player ship AND keep it pointed at the target. See attached image. I want to look over player towards target.
Hope that makes sense.

Mike

some cool stuff someone else said here

Attachments

Login to view attachments
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 26th Aug 2010 21:29
A quick and dirty way to do this would be to locate the camera in the same position as the player, point the camera at the enemy ship, the move the camera backwards, with a command like

move camera -50.0

That way the camera is still pointing at the enemy, but it backs up enough to see the player.

I'm sure there's a way to do the same thing using maths, but I am terrible at math, and lazy besides.

mikewhl
14
Years of Service
User Offline
Joined: 19th Jul 2010
Location: Columbus,Ohio
Posted: 26th Aug 2010 22:28
Even Quicker and Dirtier.
I made a dummy object, positioned on player ship,
Pointed it at target
positioned camera @ dummy
orientate to object; dummy
Move camera as you suggested.


I dunno how efficient it is, but it works.

Mike

some cool stuff someone else said here
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 27th Aug 2010 12:19
If you rather fancy the elegant way:

(I'm using vectors because it's faster)


The same applies in 3D:


Cheers!
Sven B

Login to post a reply

Server time is: 2024-11-24 11:38:40
Your offset time is: 2024-11-24 11:38:40