Page 1 of 1
External views
Posted: Sun Nov 20, 2011 11:13 pm
by Yodeebe
I'd like to work out some cinematic views, but I'm getting confused. (not difficult!!)
Would someone mind explaining the external view numbers for me?
view_description = "**** View";
view_orientation = "1.0 0.0 0.0 0.0 ";
so, 4 numbers. the 4th one is the rotation. is that in degrees? 0-360?
view_position = "0.0 14.0 -350.0";
3 numbers, so X axis, Y axis & distance?
-350 being a rear view
Where is "0"?
what's the scale in? metres?
weapon_facing = "FORWARD";
},
but all views face the ship, not forward. :/
Many thanks in advance.
Re: External views
Posted: Mon Nov 21, 2011 3:47 am
by Wildeblood
Yodeebe wrote:view_orientation = "1.0 0.0 0.0 0.0 ";so, 4 numbers. the 4th one is the rotation. is that in degrees? 0-360?
Nah, it's a "quaternion" value I believe. The view forward is
"1.0 0.0 0.0 0.0"
, but the view aft is
"0.0 0.0 1.0 0.0"
, IIRC. Definitely not in 360 degrees.
Yodeebe wrote:view_position = "0.0 14.0 -350.0";3 numbers, so X axis, Y axis & distance?
X, Y and Z - the view position can be offset to either side, above or below, or forward or behind the ship model. They are all metre offsets from the centre of the ship.
Yodeebe wrote:weapon_facing = "FORWARD";
but all views face the ship, not forward. :/
Only by tradition. You can set the view position forward of the ship with a forward orientation so the ship isn't visible. (PM with example OXP coming your way) The weapon_facing key controls which of the four weapon mounts will fire if you press the fire button while in that view.
Re: External views
Posted: Mon Nov 21, 2011 12:23 pm
by Zieman
Yodeebe wrote:view_orientation = "1.0 0.0 0.0 0.0 ";
That's where the camera points from its position. And it is a quaternion (W X Y Z), where W is some kind of coefficient(?) and X,Y & Z represent coordinate axes.
IIRC if you want to rotate an object (like subentity) or (in this case) an "object" (viewing direction) around one axis, you take the amoun of rotation in degrees (a) and insert cos(a) as W and sin(a) as corresponding axis value (X, Y or Z).
Orientation 1 0 0 0 really means rotation of 0 degrees around all/no axes/axis ( cos(0) = 1, and sin(0) = 0 ).
The matter gets a bit more complicated when you need rotations around 2 axes. I've seen 2 different spreadsheets about quaternions, and one of them has the formulas for 2-axis quaternion right. Before using the spreadsheet, you have to have visualized the needed rotations correctly - I usually twist a pencil to see how the rotations work. One could of course make a cone in Wings3D and rotate it with Absolute commands for same effect.
EDIT: checked the Wiki nad it states that the WXYZ values are in fact cos(0,5*a) and sin(0,5*a). In case of 1 0 0 0 the values are normalized (between 0 & 1) (http://wiki.alioth.net/index.php/Quaternion)
In this case "0" (origo) is at the center of player ship.
Yodeebe wrote:what's the scale in? metres?
Yes, in Oometres (Oolite metres).
Re: External views
Posted: Mon Nov 21, 2011 12:41 pm
by Eric Walch
Yodeebe wrote:I view_orientation = "1.0 0.0 0.0 0.0 ";
so, 4 numbers. the 4th one is the rotation. is that in degrees? 0-360?
When you really want to create your own quaternions for view positions, you could look
here. But even these numbers must be corrected by rotating them around the view axis until it looks okay.
Most easy will be to just re-use existing quaternions and not adding new view directions
.
Re: External views
Posted: Mon Nov 21, 2011 4:28 pm
by Yodeebe
Zieman wrote:
IIRC if you want to rotate an object (like subentity) or (in this case) an "object" (viewing direction) around one axis, you take the amoun of rotation in degrees (a) and insert cos(a) as W and sin(a) as corresponding axis value (X, Y or Z).
Orientation 1 0 0 0 really means rotation of 0 degrees around all/no axes/axis ( cos(0) = 1, and sin(0) = 0 ).
The matter gets a bit more complicated when you need rotations around 2 axes. I've seen 2 different spreadsheets about quaternions, and one of them has the formulas for 2-axis quaternion right. Before using the spreadsheet, you have to have visualized the needed rotations correctly - I usually twist a pencil to see how the rotations work. One could of course make a cone in Wings3D and rotate it with Absolute commands for same effect.
EDIT: checked the Wiki nad it states that the WXYZ values are in fact cos(0,5*a) and sin(0,5*a). In case of 1 0 0 0 the values are normalized (between 0 & 1) (http://wiki.alioth.net/index.php/Quaternion)
Good grief!!!
thanks.
Re: External views
Posted: Wed Dec 21, 2011 7:30 pm
by Amaranth
I'm trying to amend the view positions on one ship i'm working on as the ship is quite small and I want to increase the zoom a bit. Also I'm rying to amend the exhaust positions. In short, I'm changing the numbers but nothing is happening. I'm doing the shift restart for oolite and even a computer restart, but it makes no change. Any ideas please?
Re: External views
Posted: Wed Dec 21, 2011 8:47 pm
by CommonSenseOTB
Amaranth wrote:I'm trying to amend the view positions on one ship i'm working on as the ship is quite small and I want to increase the zoom a bit. Also I'm rying to amend the exhaust positions. In short, I'm changing the numbers but nothing is happening. I'm doing the shift restart for oolite and even a computer restart, but it makes no change. Any ideas please?
Watch for duplicate files.
Re: External views
Posted: Wed Dec 21, 2011 10:52 pm
by JazHaz
look out for missing i's too....