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.

Dark GDK / dbSetCurrentCamera not working.

Author
Message
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 2nd Jul 2007 15:47
dbSetCurrentCamera(1); Seems not to work. I have 3 cams 0,1,2 and the only way to get them to switch is the oder in with they are created. Is there another step? I have the dbSetCurrentCamera line in the main loop.
m2zt
19
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 3rd Jul 2007 19:35
The command works. You have to delete the current camera in order to switch to another camera.

Heres a little example.



Futurama 2008
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 5th Jul 2007 21:44
So, if you must delete a cam in order to switch a cam, whats is the point in having a dbSetCurrentCamera(). Would it not be the same as changing the position of the cam?

I though the idea was to track the cams independently then be able to switch views? If you move a cam then delete it, wouldn't creating another set it back to 0,0,0.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 10th Jul 2007 01:47
I realized this while making a wrapper class for the various functions. This stinks. I personally have resorted (though not great) to keeping a "structure" with all my own Camera info, and then I make an array of these. Then to "switch Cams" I call a routine with the index into the array - and it basically copies all the info to the GDK camera ZERO - and I in effect seem to have multiple "views" however I wonder how this effects when you WANT to have multiple cameras on the screen at one time and do things to each of them independantly? This is BAD - very BAD.

Know way too many languages - Master of none
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 10th Jul 2007 15:32
Ok so SetCurrentCamera is like the little men in green or blue suits in show biz. its fake... ;D jason it's looks as though you use a similar method. I agree it's bad, and pointless if it was designed this way. I'm hoping this is just some sort of a bug. Either there are multiple cams or there are not. If not, then there is no need for a SetCurrentCamera command.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 10th Jul 2007 22:37
Me TOO - Has anyone managed to get multiple cameras working simultaneously? Something tells me this is possibly Hosed. Perhaps we can (Speaking multi cams now not SetCurrentCam...we covered that) at least create multiple cameras (for fancy screens - with more than one viewport) but once they are created we can't work with them further - they become fixed???

Does anyone know about this aspect of DarkGDK?

Jason P Sage

Know way too many languages - Master of none
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 16th Jul 2007 16:18
jason , ever watch the camera demo? I have not yet looked deep in to the code but its doing it Simultaneously.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 16th Jul 2007 20:10 Edited at: 30th Aug 2007 03:29
@UniTech - Referring to Camera Demo - Not yet, I know it one exists with DBPro - (Perhaps the same demo "translated" for DarkGDK?) - I will need to take a look - I've done just a little experimentation and frame rates go down fast when I add a little viewport - e.g. A little Area on screen that is from another camera.

I'm currently engulfed in this Tank Game that started as an Intro to Programming for my son - in DarkBasic. He chose the DarkMAtter Tank as his first model to play with - and he did good getting it to move (Really slide) the direction of the arrows.

Well... I let loose when he was elsewhere - a few days later - I have advanced terrain, trees, the tank is fully animated - turret, barrel, shoots (Was hard/time consuming getting bullet to line up correctly with tank/terrain angles, then the turret, then the barrel...works great now though!), even (hard/time consuming kinda) the tracks work like they should - even have timed them timed so track look realistic - meaning if a piece of the track touches the ground - it stays put until the tank rolls over that spot entirely - only then does it get yanked off the ground to go around for another shot - (Describing driving forward) Turning by nature is different. In otherwords - it doesn't appear to "slide" anymore.

Anyways .. long story short (TOO LATE I KNOW) ... I need a scope for the gunner - I've play with FOV and I like that ability to change it - but now I need to figure out a good SCOPE/Targeter mechanism - and I think multiple cameras, possibly the camera to image trick - MIGHT be the way to go...

See what I've been messing with online here (One link for little movie of the tank thing - but before I got it shooting)

http://www.jasonpetersage.com/?PAGE=jpsmain&SECTION=gamedev

Best Regards,
Jason P Sage

unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 16th Jul 2007 22:20
"engulfed ".. you say. I think that putting it a bit lightly.


Shots and demos looks nice. Love the AI flying formation. I see the black square on the upper left. I'm guessing this will be the second view port. If So that example is just what you want. Best of luck to ya.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th Jul 2007 00:54 Edited at: 17th Jul 2007 00:57
The Black Square - in "Anti-gravity Figher" (the pink space one) - that is a "Map" ... kinda a CHEAP radar - where you and enemies are - (I haven't ever made a fancy one - not yet) ... but dureing development its nice to have one of those for finding bad guys quickly - and trees and stuff if I wanted.

That flying game - I don't forsee adding a "sniper" like targeting - e.g. Another camera, however, in the tank GAME....

The Tank game now has one of those "Black Square" (Cheap Godmode Radar) --- you can't see the pixels that are there in the demo you saw online - but its a simple pixel thing - white dot for "YOU" and red dots for baddies. they don't "Compress" well for recording a "movie - note also the recording process dogs the frame rates too! Game play is much better in person....

Back to CAMERA. I was thinkning it would be smart to make a NEW CAMERA, Say CAMERA 1, and configure it for a sniper view... maybe make it blakc-n-white, night vision gree, maybe not... maybe change the FOV, the camera range, etc.

[edit] IMPORTANT NOTE: I Want to toggle because I found once I change FOV, I can not "reset it" to something else. It SEEMS (could just be me) That FOV is a one shot deal for the life of the cam - it has a default (90 degrees I think) and you can change it... but trying to change it back...well... the command seems to be ignored. Just thought I'd explain why I'm not just tweaking camera 0 back and forth... or why I don't want to.[/edit]

The idea was to simply TOGGLE from One camera to another... but I don't know how to "disable" camera 0 so its stops trying to render while I FILL THE SCREEN with this new CAMERA 1. (I tried this - frame rates were pathetic - must-a been rendering both cams even though Camera 0 was completely covered by the new cam 1.

I'm about to give this another try - MAYBE with the Default CAM, and a sprite with a hole in it - or ghosted (far cry scope effect uses ghosted thing - range, and I think OFFSET PIVOT (Based on player's origin which makes sense.... BUT the TRICK is I THINK I would have to ray trace the camera constantly (because vehicle movement, and turret movement, and user changing ZOOM POWER) so that the camera isn't allowed to SEE PAST (or through like superman's xray eyes) obstructions.

I've never even tried to think about how to do this correctly.

I also haven't checked the forums and code snips etc for a sniper like sample to learn from. I think I'll do that now before I spend my after work evening (family out da house tonight ... woo hoo... don't get me wrong..love it when they are here - but I code better when house is empty or EVERYONE is sleeping.... Sometimes the wife and kids will see where I'm at as they say goodnight, and then I'm still there in the AM and they are like WHOA - Good JOB! <evil grin>

Ok - nuff chat - nice chatting with all you guys, and Unitech - Appreciate your comments

Know way too many languages - Master of none
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 17th Jul 2007 11:09
Hi, I got this little example code that uses 2 cameras (working fine):



Perhaps that helps.
I also change FOV spreadly at main camera with no problems until now.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th Jul 2007 15:14
Thanx Morcilla! I'll scope that out after work - I got to scram now - don't want to be late ...

Know way too many languages - Master of none
destroy89
17
Years of Service
User Offline
Joined: 27th Jan 2007
Location:
Posted: 17th Jul 2007 19:44
Works for dark basic pro as well. The "set camera view" command allows you to define what area a 3d camera draws to on the screen.

EzRotate has a good example in #11_FindLocalYAngleToPoint
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th Jul 2007 21:21
@destroy89 - Yeah. Thank You. "Set Camera View" works well...

And now I understand "set current camera" better. Allows camera commands without cam number - then you set "current" camera to apply those ambiguous commands to.

My issues currently that I've run into is:

ONE: I can only "SET CAMERA FOV -angle-" Once per camera. It ignores subsequent "tries".

TWO: I can not 100% Switch Off CAMERA 0 and Turn on Another one. Why? I Want default one to have its own FOV, color, position, and then TOTALLY switch (for a sniper view) to a different camera with "sniper scope" settings. If I JUST open a second camera view port or fill the whole screen - camera zero still renders - and dogs the framerates to a crawl.

Thanks for the help thus far people. Does any one simply have a cheap sample of a "sniper scope" demo? Just to get the "Technique" down that works in db pro?

Jason

Know way too many languages - Master of none
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 18th Jul 2007 11:33
Don't know what you mean about setting the camera FOV, I do it all the time with no problems.

Try to reduce the camera 0 viewport to 1 pixel to see if the speed increases. There must be snipper code examples at the code snippets forum, perhaps multiple cameras is not the only way.

Login to post a reply

Server time is: 2024-11-19 14:40:21
Your offset time is: 2024-11-19 14:40:21