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 / The direction of an object in DBPro

Author
Message
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 12th Jul 2003 17:43
I'm merrily drafting some functions to allow my 3D game to have wingmen.

So far, so good. However, I thought I'd seek the wisdom of the people here as to one issue that has cropped up.

One of the functions I've been writing makes a wingman fly up and form on the wing of a nominated object, i.e. after a battle has finished, after leaving a mother ship, etc. What I am curious about is whether there is any command in DBPro that returns the direction the object is pointing? I've looked at writing a custom function with the object angle x, y, z commands but I haven't had any brainwaves.

Obviously an easy way to achieve my goal of getting the wingman to fly up to the wing position would be to return the x, y and z positions of the wingman's destination, then point object to those coordinates then and then move object, i.e.

This seems like cheating to me though.

I'd much rather write a function based on returning the direction the wingman is pointing, and then fly it to the destination from there via some trig and vectors, etc.

I'm wondering if anyone has any views on this?

Phil
What do you mean, bears aren't supposed to wear hats and a tie?
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 12th Jul 2003 20:21
Well paint my bottom blue and call me frank, I posted way too soon.

After some playing, I've discovered that:

x# = object angle x(obj number)

returns a value of 0 to 90 and 360 to 270 (looking down on the object) and

y# = object angle y(obj number)

returns a value of returns a value of 0 to 360 in a clockwise rotation

So evidently these commands will return the direction of the object.

I am, however, still utterly baffled by z# = object angle z(obj number) as I can't get z# to be anything other than 0.

Also, I still haven't found a command which returns the roll value of the object. I really need that. Damnation.

Still, I'm just a bear with an odd taste in millinery. Even being able to programme this much is pretty astonishing, when you think about it.

Phil

What do you mean, bears aren't supposed to wear hats and a tie?
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 13th Jul 2003 14:43
I've discovered a couple of bugs whilst attacking this exercise. See the 3 dimensional chat post.

Phil

What do you mean, bears aren't supposed to wear hats and a tie?
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 13th Jul 2003 15:39
object angle z() should return the value an object has rolled because when you use zrotate object it rotates like an airplane rolling

***Ordered Dbpro today(friday 11th)****
Saturday AM+PM: Not Dispatched
Sunday AM: Dispatching shortly
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 13th Jul 2003 16:10
It doesn't on DBPro. I refer to the long thread that is developing between WindTech and myself on the 3 Dimensional chat forum.

In fact, object angle z() always returns a 0 when you try a roll object left or roll object right command. It does return a value when you try z rotate object. However, z rotate object is no good as its relative to the world and not the object!

Phil

What do you mean, bears aren't supposed to wear hats and a tie?
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 13th Jul 2003 22:35
yeah i read that after i posted here, its a problem indeed!

***Ordered Dbpro today(friday 11th)****
Saturday AM+PM: Not Dispatched
Sunday AM: Dispatching shortly
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 14th Jul 2003 16:56
I think my comments were misconceived though. object angle z() returns the z rotation angle relative to the world coordinates. It doesn't return the roll angle relative to the model's coordinates.

I've had to adopt a very complex method to fix this problem. See my post in the 3 dimensional forum.

Phil

What do you mean, bears aren't supposed to wear hats and a tie?
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 14th Jul 2003 20:07
This problem is now solved. See my post plus the attached source on the 3 dimensional forum.

Phil

What do you mean, bears aren't supposed to wear hats and a tie?

Login to post a reply

Server time is: 2024-11-24 23:08:41
Your offset time is: 2024-11-24 23:08:41