Page 1 of 1

Cameras in zscript

Posted: Fri Jun 22, 2018 12:28 pm
by Apeirogon
I want to made camera which show what player have behind him in the upper side of screen, like rearview mirror.
Is it possible to do so using only zscript?

Re: Cameras in zscript

Posted: Fri Jun 22, 2018 12:46 pm
by krokots
I think that's totally possible. I created something extreme similar in FamiliarDoom - a little view from familiar. Check out either my code (ZScript/HUD, hud mini camera) or try to experiment with function in TexMan class

Code: Select all

native static void SetCameraToTexture(Actor viewpoint, String texture, double fov);
You'll need to make a dummy actor which always will be at the same position as player, but looking opposite direction.

Re: Cameras in zscript

Posted: Fri Jun 22, 2018 2:13 pm
by Matt
Check out the test files in this bug report.

(hopefully the bug in question will be fixed by the time you implement this)

For the angle and position you might need to have an actor that constantly follows the player and sets its angle to the player's minus 180.

Re: Cameras in zscript

Posted: Sat Jun 23, 2018 8:24 am
by Apeirogon
...and also change camera pitch to (-player.pitch).