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.

DLL Talk / EZrotate Orbit

Author
Message
Omikron
20
Years of Service
User Offline
Joined: 12th Mar 2004
Location: UK
Posted: 5th Apr 2005 07:18
Excitedly I installed EZrotate a short while ago.

The first thing that caught my eye was the rotate command

EZro_Orbit RotateFlag, OriginX#, OriginY#, OriginZ#, point2X#, point2Y#, point2Z#, angle#

The first thing I did was try to make a sphere that orbits around a point in space with this command.

something like



Okay, i'm lost. the EZrotate orbit thing doesn't have parameters for specifying an object.

If anyone has any ideas, please put me out of my misery.

BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Apr 2005 09:38
EZrotate doesn't work with your DB objects. You feed it coordinates and it gives you results.

It's up to you to apply the results to your object.

The examples that get installed with it are top notch. Very basic, but that's what you need when you are learning

You need example 3.

BatVink
Omikron
20
Years of Service
User Offline
Joined: 12th Mar 2004
Location: UK
Posted: 6th Apr 2005 03:51
I did have a look at the examples, I was curious as to why it used a door instead of what I would normally associate with orbits: planets.

Will check it out a bit harder. Thanks

BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 6th Apr 2005 07:17
Change lines 85 and 89, and you'll get a better idea. Wolf has put the centre-point on the edge of the door, which makes sense for a door. Move the centre-point way off to the left, and it will make more sense in the context that you want to use it...



BatVink
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 6th Apr 2005 08:04
Omikron,
There are a few reasons why I didn't make EZrotate directly linked to objects. The main one is efficiency. To perform an action with EZrotate, you convert DBpro's Euler angle values to a rotation matrix (stored within EZrotate). There is a decent amount of math involved to go back and forth from Euler angles and a Rotation Matrix.
With the way it is set up now, you convert the Euler angles to a matrix, you then perform as many actions as you want, and finally you convert the matrix back to Euler values and send that back to your DBpro object.
If I was to make it directly linked to your objects, then the conversion calculations would still take place behind the scenes, but happen for every action that takes place. So, if you wanted to rotate something on the X axis then the Y axis this would happen:
-convert to matrix
-rotate on x
-convert to euler
-convert to matrix
-rotate on y
-convert to euler

With the way it is now, although it is not transparant, only the following steps take place
-convert to matrix
-rotate on x
-rotate on y
-convert to euler

As for the door example, follow what Batvink suggested. I tried to build the examples more and more difficult from start to end. It might do some good to understand how example 1 and 2 work also. The orbit command has a lot of parameters and might seem confusing at first. It really isn't bad once you understand the way EZrotate works though.

Regards,
Ron Erickson

EZrotate!
Tokamak Physics Wrapper!

Login to post a reply

Server time is: 2024-03-28 22:15:55
Your offset time is: 2024-03-28 22:15:55