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?
Cameras in zscript
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Re: Cameras in zscript
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
You'll need to make a dummy actor which always will be at the same position as player, but looking opposite direction.
Code: Select all
native static void SetCameraToTexture(Actor viewpoint, String texture, double fov);
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: Cameras in zscript
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.
(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
...and also change camera pitch to (-player.pitch).