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 / Camera function

Author
Message
Jna99
19
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 28th Jan 2006 02:33
Hi I'm trying to improve the dbSetCameraToFollow but I'm having dificulties to acomplish that..Well the idea is, when you pitch up/down the camera auto-center like it does when you turn left/right! But to do that I need to make the original dbSetCameraToFollow, which is being a little challeging...so any help would be good

p.s I'm trying to improve my 3d space simulator if U wanna see take a look

Attachments

Login to view attachments
Vlad
19
Years of Service
User Offline
Joined: 5th Oct 2005
Location:
Posted: 29th Jan 2006 11:19
Hi Jna99

Nice to see another portuguese.

I faced a problem (lack of knowledge to be honest) regarding the camera. Everything that to do with the camera looking at somepoint, be it roll, pitch or turn, had to be done every time the screen syncs.

I solved it by creating a function that handled everything that needed to be sync on screen and instead of calling dbSync() I call my function gameSync() that includes every camera and object animation. The last line of the funcion is dbSync().

Hope this helps.

V

p.s.: nice looking screenie! Keep up the good work.

The only lazy people that can complete games are genius. You don't look like a genius, so you better stop being lazy.
Support your local Riker 9 Chapter.
Jna99
19
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 30th Jan 2006 01:50
Hi Vlad nice to see another Tuga

Well as you can see in the image my camera is allways behind the ship, I acomplish that, by using the function (bellow) everytime I turn or pitch..It works but I'm interested in making a more dynamic camera!
Timidon
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 30th Mar 2006 21:05
Quote: "Well as you can see in the image my camera is allways behind the ship, I acomplish that, by using the function (bellow) everytime I turn or pitch.."


Maybe you can help me, this is what I am trying to accomplish, keeping my camera behind my ship, like when I turn -extra.... the camera keeps focused on the ship.

There are many answers but just one question" ~ Jerilith the Mad
RomuluS
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 3rd Apr 2006 15:49 Edited at: 3rd Apr 2006 15:50
i don't know about DarkGame SDK, but in dark basic pro it's rather simple...
first you need your objects position, (OX, OY, OZ), and it's angles (OAX, OAY, OAZ).
then get the camera positions (CX, CY, CZ)
in dbpro:
CX = newxvalue(OX,wrapvalue(OAY + 180),<distance from the ship> )
CZ = newzvalue(OZ,wrapvalue(OAY + 180),<distance from the ship> )
CY = OY + <height above the ship>

that will give you the camera position in 2 Dimensions (around the ship when it's not pitching up or yawning).that's basically good for third person camera, but in "space" it get a helluva lot trickier.
then you position your camera to CX, CY, CZ
and then point it at OX, OY, OZ.

now if you would like to put the camera so that your camera isn't entirely centered on the object, you can change the OY to (OY + value above the ship). this will position the ship alittle bit underneath the camera centerpoint, and changes the camera focus to something further away (you don't want to restrict the players view, with the ship, or make aiming harder because the ship is entirely infront of the camera, and thus you can't see the spot you are aiming at.)

i've never done the camera thing in "space" (where "space" means a gaming area where the player can go up or down), and i'm not entirely sure as to how to compleate it.

all those should be available on DarkGameSDK too i think, and there propably is some sort of command listing, or something with darkgame SDK.

and yes, use a function, the beauty of C++ is headers and assosiated Cpp files, that you can use... so i suggest to make your own headers for those camera handling thingies... then you can just copy the headerfiles into your projects and just #include them in your code, so you don't have to write them everydamned time, you want to try out something...
also i also suggest using structures to store your player position and camera positions, so you'll have everything you need within a
single variable...

i ordered DGSDK a few days ago, still waiting for it to come, and waiting to get my hands on changing DBPro code to C++... so that's why i don't know the names of those commands in DGSDK... but i think they should be there... (if they aren't, i'm gonna get some rope and ladders...)
Timidon
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 3rd Apr 2006 17:44
Thanks, I should be able to do a conversion without much difficulty.

There are many answers but just one question" ~ Jerilith the Mad
RomuluS
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 4th Apr 2006 02:48
if you do get the camera movement working in "true 3D", i'd be very happy if you could post it here...

and my order came! *bounces around*

Login to post a reply

Server time is: 2024-11-19 05:42:28
Your offset time is: 2024-11-19 05:42:28