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.

DarkBASIC Professional Discussion / camera views confusing

Author
Message
nruser
18
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Serbia
Posted: 8th Feb 2011 16:38
i have tried to make four camera views for may level editor by i can't get this to work



how this line

can set the viewport to top left corner of the screen, what i think this command should do is set camera view 1,0,0,640,480.

The problem for me is that i can't get that command to put four camera views to all four corners of the screen and i can't get them to update at sync times. Can someone help me with this?
Rich Dersheimer
AGK Developer
17
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 8th Feb 2011 16:45
To set camera 1 to the top left quarter of the screen, use

set camera view 1,0,0,screen width()/2,screen height()/2

That matches what you are doing with the other three cameras.

nruser
18
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Serbia
Posted: 8th Feb 2011 17:21
i have tried that but then there is no viewport in that corner, look in camera example in help files to see the problem. Also from all four viewports only one that is assigned to camera 0 is positioned and working correctly from code above.
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 8th Feb 2011 17:38
Well I have had a quick try and it seems to work here ok.


That creates 4 windows at the correct co-ords to make 4 windows. I haven't used screen width but merely put in the values manually. I cannot see a problem to change it to use screen width though.

http://s6.bitefight.org/c.php?uid=103081
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Feb 2011 17:54
Don't forget to use



before doing anything with cameras.

Something like this (plus Rich Dersheimer's suggestion):

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 8th Feb 2011 18:14 Edited at: 8th Feb 2011 18:16
Yes, I left it simply to avoid positioning the first camera. Just lazy for the purposes of this quick demo. Autocam, can cause problems and confusion!

http://s6.bitefight.org/c.php?uid=103081
nruser
18
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Serbia
Posted: 8th Feb 2011 21:45
ok i have fixed the problem with views but now i have new problem what should i do to get all viewports to show same grid that is drawn with d3d plugin when i use draw to camera or such i get my editor crashing with error "memory could not be read at address..."? is there some way to get this to work? because this is a problem only with the grid i can see the cube from code above but grid crashes.
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 12th Feb 2011 22:11
It may be the plugin haveing an issue with multiple camera's maybe, I couldn't say. Could you not just use a matrix for a grid? It is a fairly easy way to display a grid of any size and depth.

http://s6.bitefight.org/c.php?uid=103081

Login to post a reply

Server time is: 2026-07-16 04:36:19
Your offset time is: 2026-07-16 04:36:19