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 Discussion / Overhead camera & clickable objects?

Author
Message
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 13th Jan 2008 01:04
How might I manage to do an overhead camera & clickable objects?
I had an idea for the overhead camera but it wouldn't work and wouldn't clickable objects be the same as images?

Please Help and Thanks,
Zeus


Formerely Cool Guy Jordan
Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 13th Jan 2008 01:17
Quote: "How might I manage to do an overhead camera & clickable objects?"


set the camera above the object and point the camera down. There is a code snippet in the code snippets thing with some code for clickable objects, i managed to get it to work fine for me with just some minor adjustments.

Free music @ www.Soundclick.com\Peacemaker
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 13th Jan 2008 02:12 Edited at: 13th Jan 2008 02:12
Umm.. I can't seem to find the code snippet, you mind to give me a direct link?


Formerely Cool Guy Jordan
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 13th Jan 2008 02:17
If your camera isn't moving then it's quite simple
use the object screen x() & object screen y() commands to find the centre of your objects, then make a box/circle around that point to check for collisions with mouse position.

Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 13th Jan 2008 02:32 Edited at: 13th Jan 2008 02:39
oh damnit, i was going just to post the code here that i used for my game, it was real neat, it worked with moving cameras and whatever angle you wanted and stuff, but i accidentally overwrote it a while ago without realising sorry..

edit -

I think you should be able to figure this out for yourself, it isnt actually that hard. and you've been using dbc for a while now, i think you probably could figure this out..

Free music @ www.Soundclick.com\Peacemaker
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 13th Jan 2008 18:16
One question, what the hell moves the camera over left? Is the x axis in position camera, because it is just rotating left.


Formerely Cool Guy Jordan
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 13th Jan 2008 22:50
umm... what is left?

Are you trying to rotate the camera or move it?
Remember, if you move the camera you will have to re-focus it using the POINT CAMERA command

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 13th Jan 2008 23:29
Move it, and I am using point camera.


Formerely Cool Guy Jordan
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 13th Jan 2008 23:50
If you are trying to strafe the camera (move it sideways while you are looking in one direction) then you have to calculate the new position based on 90 degrees to the current y angle the camera is facing.

So if you want to move the camera 5 units left or right for example:



Enjoy your day.

Login to post a reply

Server time is: 2025-06-02 10:09:17
Your offset time is: 2025-06-02 10:09:17