I'm trying to fit turrets to a ship at the moment and have no idea how I should determine the up and forward vector. The up vector obviously is the normal vector of the face I want to attach the turret to but how do I get the values for this vector in blender or wings3d? The forward vector would have to be orthogonal to the normal vector and aligned with the zx plane. Again no idea how to get the values in blender or wings3d though I might be able to calculate the second vector from the first if I think hard enough about it...
Any help on this would be greatly appreciated.
How to determine the up and forward vector of a subunit
Moderators: Omega, tillias, Mod Contributor
-
- Mercenary
- Posts: 121
- Joined: Thu Jan 15, 2004 5:42 pm
How to determine the up and forward vector of a subunit
Last edited by Beowulf on Tue Sep 25, 2007 9:43 pm, edited 1 time in total.
"History is on the move, Captain. Those who cannot keep up will be left behind, to watch from a distance. And those who stand in our way, will not watch at all."
Grand Admiral Thrawn
Grand Admiral Thrawn
-
- Lead Network Developer
- Posts: 2560
- Joined: Sun Jan 12, 2003 9:13 am
- Location: Palo Alto CA
- Contact:
I think in the Wings3D XMesh export plugin you specified mounts by adding something like a point or direction light.
Really, I'm not sure how this works...
One possibility would be to make the polygon with the turret a certain material, and then look in the XMesh for the polygon in a different material.
Really, I'm not sure how this works...
One possibility would be to make the polygon with the turret a certain material, and then look in the XMesh for the polygon in a different material.
-
- Elite Hunter
- Posts: 1149
- Joined: Mon Aug 14, 2006 3:56 pm
- Location: Black Forest, Germany
I don't know how this works within Wings3D or Blender, but you can easily reangle the values within units.csv. For example, here is the turret file for the PR1.2 Centurion:
The line defines the following values:
{file;x;y;z;forex;forey;forez;upx;upy;upz;restricted}
play around with those values, but my guess is (w/o guarantee):
xyz is the position on the ship
forexyz is the position where the "nose" shall point to
upxyz is how far it can turn
restricted = no idea
Code: Select all
{mediumrear_blank;0;-.005;-0.390673;0;0;-1;0;1;0;90.0}
{file;x;y;z;forex;forey;forez;upx;upy;upz;restricted}
play around with those values, but my guess is (w/o guarantee):
xyz is the position on the ship
forexyz is the position where the "nose" shall point to
upxyz is how far it can turn
restricted = no idea
-
- Mercenary
- Posts: 121
- Joined: Thu Jan 15, 2004 5:42 pm
I know what these values do, I'm looking for a mathematically precise way to get the values for the fore and up vectors. I think I'll have a solution for this in the evening. If I'm not mistaken restricted tells the turret how far it can turn (usually this would be 180 degrees for a turret).
Thanks for the help
Thanks for the help
"History is on the move, Captain. Those who cannot keep up will be left behind, to watch from a distance. And those who stand in our way, will not watch at all."
Grand Admiral Thrawn
Grand Admiral Thrawn
-
- Mercenary
- Posts: 121
- Joined: Thu Jan 15, 2004 5:42 pm
I've made a little openoffice calc spreadsheet that calculates the values for the forward and up vector if you give it three points in space that define the plane on which you want to place your turret:
http://www.hawo.stw.uni-erlangen.de/~si ... turret.ods
http://www.hawo.stw.uni-erlangen.de/~si ... turret.ods
"History is on the move, Captain. Those who cannot keep up will be left behind, to watch from a distance. And those who stand in our way, will not watch at all."
Grand Admiral Thrawn
Grand Admiral Thrawn
-
- Elite Venturer
- Posts: 753
- Joined: Sat Apr 15, 2006 2:40 am
- Location: chthonic safety
I suspect that it's desirable (maybe even necessary) to have normalized vectors (length=1) there, but did not researched question in code.Beowulf wrote:I'm trying to fit turrets to a ship at the moment and have no idea how I should determine the up and forward vector. The up vector obviously is the normal vector of the face I want to attach the turret to but how do I get the values for this vector in blender or wings3d?
But it's very simple. Place 1x1x1 cube at the surface where you want to add turret, and it's top face will look "up". Turn cube around one of edges perpendicular to that surface (or normal to surface as such) until one of its faces looks "forward". Now you have 4 edges perpendicular to "up" face for choice as a ready normalized "up" vector and another 4 edges perpendicular to "forward" face are all equal to normalized "forward" vector.
In Wings3D: select some face on ship -> "save BB" -> create 1x1x1 cube -> select any face on it -> "move to BB / all" -> select entire cube, vertices mode -> turn / around selection (faces mode, select "up" or "down" face | edge mode and select "up" edge), then you can select single edge of cube and see its components (XYZ). Rather long description, but once base face is selected, vectors are only few mouse clicks and/or pressed keys away.
I don't know Blender controls yet, but i saw there's some measuring plugins, so if you can place unit cube properly, you'll get vectors too.
And they accuse me of practicing necromancy! That plugin appears to have rigor mortis.ace123 wrote:I think in the Wings3D XMesh export plugin you specified mounts by adding something like a point or direction light.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
-
- The Shepherd
- Posts: 5841
- Joined: Fri May 13, 2005 8:37 pm
- Location: Ottawa
- Contact:
The plug-in is stuck on an earlier version of Winds3D just won't work with any current version.
Enjoy the Choice
Enjoy the Choice
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2