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.

Newcomers DBPro Corner / set camera to object orientation

Author
Message
malcom2073
21
Years of Service
User Offline
Joined: 12th Mar 2003
Location:
Posted: 26th Jun 2007 04:02
Hey, I'm trying to make a space video game, where the mouse positionon the screen effects how your ship moves. The ship object moves correctly, but the camera will not stay with it.
I position the camera in the same location as the object, that works fine. The camera will not stay pointed in the same direction though. here's a clip of my code:



I have also tried the rotate camera command with the object angles, that does not work either. Any thoughts?
malcom2073
21
Years of Service
User Offline
Joined: 12th Mar 2003
Location:
Posted: 26th Jun 2007 05:36
Ok, seems that turn object and pitch object do not change the object angle x y or z. So you cannot do freeform rotation and read the angle at which the object is? turn object left 1,90, and object xy and z all still read 0.
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 26th Jun 2007 06:56
Instead of "set object to camera orientation" try using the rotate camera command.

That command usually works better.

http://www.funk.us.tt/
malcom2073
21
Years of Service
User Offline
Joined: 12th Mar 2003
Location:
Posted: 26th Jun 2007 12:49
Dosen't work. The object angle's never change when you use turn object. Anyone know the math for freeform rotation on a local axis, in relation to the global axis?
z i l c h vortex
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: united kingdom
Posted: 27th Jun 2007 01:00
malcomim making a space game to if you want help email me or add me on msn IDH_Josh@hotmail.com

this is what i used for the camera in mine



life is short but so am i
malcom2073
21
Years of Service
User Offline
Joined: 12th Mar 2003
Location:
Posted: 2nd Jul 2007 18:05
zilch: that code dosent work, turn/pitch object dosent update the global angles of that object. I wound up having to use EZrotate, which I really don't particularly like, until I figure out the math to doing local/global angles myself.
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 2nd Jul 2007 23:46
Hi friend !! malcom2073 , could you put your entire code here in order to see wher code fails



you can put the camera in the same x,y,z of th ship and then move the camera a litle bit just not stay into object and turn both(object and camera) the same quantity

have a look to this code where the object(GUN)isn´t locked to screen but rotate with mouse moving like camera do

cheerz.




oh my god
malcom2073
21
Years of Service
User Offline
Joined: 12th Mar 2003
Location:
Posted: 3rd Jul 2007 17:57
No, I cant post the entire code here. It's rather long to post, and I do not plan on releasing it. The problem is, I have to get the objects angle eventually, for movement. I'm just using EZrotate, unless someone has the math to figure out local angles from global?
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Jul 2007 23:51
Sorry, I didn´t pretend to disturb you. good luck and find what you are lookin for....

Cheerz.

oh my god
malcom2073
21
Years of Service
User Offline
Joined: 12th Mar 2003
Location:
Posted: 5th Jul 2007 07:13
So I'm asking the wrong question:

I want to know how to retrieve, and set local axis' in relation to the global xyz axis'. Much as EZ rotate does it, but without having to use an external plugin.
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 5th Jul 2007 11:23
Object's angles DO change with the 'free-flight' rotation commands. This code proves it. Is it possible you are using an old version of DBPro as this was a problem some time ago. We are on 6.6b now.



Boo!
malcom2073
21
Years of Service
User Offline
Joined: 12th Mar 2003
Location:
Posted: 5th Jul 2007 20:19
Alright, apparently it said it was updated, but it was not. I reinstalled darkbasicpro and now it works. No idea why, but thanks!
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 6th Jul 2007 00:37
Yeah, the last couple of patches seem to have an installation problem for some people where not all files get installed. You have to rerun the patch exe and run the repair option.

Glad to hear your problem is now sorted.

Boo!

Login to post a reply

Server time is: 2024-09-27 00:18:50
Your offset time is: 2024-09-27 00:18:50