External views

General discussion for players of Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
Yodeebe
---- E L I T E ----
---- E L I T E ----
Posts: 261
Joined: Mon Oct 13, 2008 7:32 pm
Location: Namab

External views

Post 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.
Image
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: External views

Post 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.
User avatar
Zieman
---- E L I T E ----
---- E L I T E ----
Posts: 680
Joined: Tue Sep 01, 2009 11:55 pm
Location: in maZe

Re: External views

Post 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)
Yodeebe wrote:
Where is "0"?
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).
Last edited by Zieman on Mon Nov 21, 2011 12:48 pm, edited 1 time in total.
...and keep it under lightspeed!

Friendliest Meteor Police that side of Riedquat

[EliteWiki] Far Arm ships
[EliteWiki] Z-ships
[EliteWiki] Baakili Far Trader
[EliteWiki] Tin of SPAM
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: External views

Post 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 :wink: .
User avatar
Yodeebe
---- E L I T E ----
---- E L I T E ----
Posts: 261
Joined: Mon Oct 13, 2008 7:32 pm
Location: Namab

Re: External views

Post 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.
Image
Amaranth
Dangerous
Dangerous
Posts: 96
Joined: Wed Oct 19, 2011 9:07 pm

Re: External views

Post 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?
On a break
User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

Re: External views

Post 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.
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
User avatar
JazHaz
---- E L I T E ----
---- E L I T E ----
Posts: 2991
Joined: Tue Sep 22, 2009 11:07 am
Location: Enfield, Middlesex
Contact:

Re: External views

Post by JazHaz »

look out for missing i's too....


:twisted:
Post Reply