Page 1 of 1

Quaternion Question

Posted: Tue Dec 13, 2011 2:53 pm
by mandoman
I've been looking around the Internet at other examples of games using ball turrets, and one thing I keep stumbling over is something I don't see in the Oolite HowTo on Quaternions. It's the reference to determining the rotation of a ball turret on the Y axis, OFFSET by the X axis. This seems to be referring to how the turret acts when facing outward from the side/top/bottom of the ship, which is one of my biggest roadblocks at the moment. It has always seemed to me that a ball turret, unless pointing straight up or down, is always rotating on the Y axis......except I keep running into the X axis problem when the ball turrets are way off to one side, or the other from the center of the ship.

Does the Quaternion calculators provided for use in figuring Quaternions for Oolite already have this factor built in to the equation? I know on one ship I have made, and now maybe two, that the ball turrets I have pointing any direction other than straight forward, or straight back, don't point out straight from the origin, but rather tilt radically toward one side, or the other, and sometimes even backwards, in toward the ship. It feels like I almost have a grasp on this, but I just can't resolve those X axis offsets. Anyone care to enlighten me? Thanks. :)

Re: Quaternion Question

Posted: Tue Dec 13, 2011 3:27 pm
by Smivs
Hi Mandoman.
my new WonderWorm has side turrets. I'm no expert at these but I got them going by trial and error. It might be of some help or give you some insight if you had a look at the shipdata in it.

Re: Quaternion Question

Posted: Tue Dec 13, 2011 3:45 pm
by mandoman
Smivs wrote:
Hi Mandoman.
my new WonderWorm has side turrets. I'm no expert at these but I got them going by trial and error. It might be of some help or give you some insight if you had a look at the shipdata in it.
*************** :lol: *********************

I'm sorry Smivs, but what a riot. that little bugger is one big ballturret, :lol: .

Thanks for the lead. :D

Re: Quaternion Question

Posted: Tue Dec 13, 2011 3:51 pm
by Smivs
Hehe....it's your fault really :wink: I got the idea while debating uber-ships with you on another thread :P

Re: Quaternion Question

Posted: Tue Dec 13, 2011 4:00 pm
by mandoman
Smivs wrote:
Hehe....it's your fault really :wink: I got the idea while debating uber-ships with you on another thread :P
Hah! Rubbing off on you, eh? :D

Re: Quaternion Question

Posted: Tue Dec 13, 2011 4:52 pm
by Eric Walch
the few times I added ball turrets, I noticed it is quite difficult to see if they are added in a correct rotation because they tend to rotate themselves. The trick I used it to start adding them as plain subentities. Than its easier to visually check the correct orientation. And with the console it is possible to play a bit with the position and orientation property until satisfying.

e.g. by typing: player.ship.target.subEntities[0].orientation = [w,x,y,z]

When everything seems okay, make them turrets again.

Re: Quaternion Question

Posted: Tue Dec 13, 2011 5:05 pm
by mandoman
Eric Walch wrote:
the few times I added ball turrets, I noticed it is quite difficult to see if they are added in a correct rotation because they tend to rotate themselves. The trick I used it to start adding them as plain subentities. Than its easier to visually check the correct orientation. And with the console it is possible to play a bit with the position and orientation property until satisfying.
When everything seems okay, make them turrets again.
That's good advice. I have yet to learn how to work with the console. I try to give it commands using the instructions I can find, but I always get something like "syntax error", or "no such thing as". Is there a comprehensive guide somewhere on using it? I have read the ReadMe in the oxp, and I guess I'm just not understanding it. What ever, thanks for the advice. I WILL take it seriously. :)

Re: Quaternion Question

Posted: Tue Dec 13, 2011 11:08 pm
by Gimi
mandoman wrote:
That's good advice. I have yet to learn how to work with the console. I try to give it commands using the instructions I can find, but I always get something like "syntax error", or "no such thing as". Is there a comprehensive guide somewhere on using it? I have read the ReadMe in the oxp, and I guess I'm just not understanding it. What ever, thanks for the advice. I WILL take it seriously. :)
I second this. I use the console, but it's more or less a hit and miss thing. Good instructions, with examples, would be very much appreciated.