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.

AppGameKit Classic Chat / How can I create a camera with ID=2?

Author
Message
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 21st Dec 2018 22:03 Edited at: 21st Dec 2018 22:04
The camera commands say:

e.g.:
SetCameraPosition
Description
Sets the position of the specified camera. By default cameras are positioned at 0,0,0 The main camera is ID 1.

https://www.appgamekit.com/documentation/Reference/3D.htm
How do I create a camera? CreateCamera() is not a command. The help doesn't show it or I don't see it.

I thought, I could set some cameras and switch between them. Maybe with something like: SetCameraActive() or SetCameraMain() ...

How would I do On-Screen-Splitscreen-Multiplayer? Only with the first camera and switching the position for every player and render the complete frame out onto a render image? But in truth I have only cameraID = 1? So I would need a complete camera value saving structre / type thingly by myself?
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 21st Dec 2018 23:14
yes there's only 1 camera, i guess it's just a placeholder for future but never got implemented yet.
render images as you suggested will work fine though.
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 22nd Dec 2018 18:29 Edited at: 22nd Dec 2018 18:30
Quote: "How would I do On-Screen-Splitscreen-Multiplayer?"


Use SetCameraBounds()

I can not remember who posted this code and I take no credit for it, an example of using SetCameraBounds() to render view ports without having to render images.


Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 22nd Dec 2018 18:51
that's really cool, and shows a good case for how to split up the sync rendering process.
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 22nd Dec 2018 19:12
I Just remembered, the above code had a problem when rendering certain aspect ratios, replace Render3DToArea() with the below function

Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 22nd Dec 2018 19:36
Now there's a very good example of how it's done.
Thanks, that will certainly come to good use sometime

Could also be of use for rearview mirrors on say a car(hint-hint).
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 22nd Dec 2018 20:29
@PartTimeCoder thx
@Rick Nasher ... or Portal
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 23rd Dec 2018 19:23
True. Thought about that indeed hehehe..
Merry Christmas and a Happy New Year.
PSY
Developer
8
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 23rd Dec 2018 19:47
Quote: "I can not remember who posted this code and I take no credit for it, an example of using SetCameraBounds() to render view ports without having to render images."


Bengismo did
https://forum.thegamecreators.com/thread/222064


PSY LABS Games
Coders don't die, they just gosub without return
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 24th Dec 2018 22:48
Wow, this is very neat. Thanks for revealing these tricks, much appreciated!

Login to post a reply

Server time is: 2024-11-23 09:02:56
Your offset time is: 2024-11-23 09:02:56