General Question Attachment help

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
10,540
Reaction score
4,372
Points
203
Location
Dallas, TX
I need some help on an attachment.

It basically is needs to be 45 degrees down. I ran the Vector normalizer.

vector1.jpg

parent
Code:
AE352= CreateAttachment (false,_V( -5.21, -2.18,  84.95),_V(0,0,-1),_V(0,1,0),"AE352",false);//storage

child
Code:
0 0 0.0  0 0 -1  -0.578310060871189 0.550758748998048 -0.601849045772499  AE35S

but it isn't correct

---------- Post added 07-29-13 at 06:03 AM ---------- Previous post was 07-28-13 at 04:49 PM ----------

Got closer. But can't get it to rotate down
PArent
Code:
AE352= CreateAttachment (false,_V( -5.18, -2.2,  84.95),_V(0,0,-1),_V(0,1,0),"AE352",false);//storage
child
Code:
0 0 0.0  .707 0 .707  0 1 0

It needs to be so the handle (green Arrow) matches the (blue arrow)
This is the side view.
AE35NEWPLACEMENT2.jpg
 
Last edited:
Without any information on the orientation of your parent and child vessels in their respective local frames it's impossible to answer. Looking at your pictures, it seems the parent attachment point is sticking out at 45 degrees, while the child's attachment point is aligned with an axis. But in your attachment definitions it's the other way round. (unless the little cube is the parent, and the large octagon is the child).
 
Thanks. Not sure if I need to adjust rotation or direction. If direction tells where the top is? Then this is correct. So maybe adjust the Direction so it is angled down?

---------- Post added at 07:39 AM ---------- Previous post was at 07:37 AM ----------

Without any information on the orientation of your parent and child vessels in their respective local frames it's impossible to answer. Looking at your pictures, it seems the parent attachment point is sticking out at 45 degrees, while the child's attachment point is aligned with and axis. But in your attachment definitions it's the other way round. (unless the little cube is the parent, and the large octagon is the child).
Thanks. The Large octagon is the parent. the cube is the child.

---------- Post added at 03:53 PM ---------- Previous post was at 07:39 AM ----------

Hope this helps.

It fits x and z into the containter. But It needs to be angled down.
VECTOR2.jpg


---------- Post added at 05:42 PM ---------- Previous post was at 03:53 PM ----------

vector3.jpg
Here are the directions/axis. The cube needs to fit into the grey box on the hexagon structure
 
does it do anything ? You could just rotate it in the 3D program.
 
Not really. It is a vessel. But it needs to store up in that box at a 45 degree
 
I won't ask why you chose such a strange axis alignment for your octagon vessel. The assumption of a diagonal inertia tensor is definitely not satisfied here, so you may get strange physics, but anyway, I guess that's not the point.

It looks like your parent attachment point is rotated by around 45 degrees in both x and y, so the (0,0,-1) direction is definitely wrong. It should instead be something like

[math]
\left(\begin{array}{ccc}
\cos b & 0 & -\sin b \\
0 & 1 & 0 \\
\sin b & 0 & \cos b
\end{array}\right)
\left(\begin{array}{ccc}
1 & 0 & 0 \\
0 & \cos a & -\sin a \\
0 & \sin a & \cos a
\end{array}\right)
\left(\begin{array}{c}
0 \\ 0 \\ 1
\end{array}\right)
[/math]
where a and b are the corresponding rotations (both around 45 degrees, from the looks of it). The rotation alignment vector needs to be rotated with the same transformation.

On the child vessel, the attachment direction is probably the usual (0,0,1), or whatever side you placed the attachment on.
 
Thanks. Actually the octagon part is a part of a larger vessel. It is like a hallway with a storage bin.

Because of the "diagonal inertia tensor" it may have to be at a level position.

Yes it is 45 degrees on both.

Sin and cos of 45 is .70711

SO the parent should be?

Code:
AE352= CreateAttachment (false,_V( -5.18, -2.2,  84.95),_V(.497468,.497468,1),_V(.497468,.497468,1),"AE352",false);//storage

child

Code:
0 0 0.0  0 0 -1  0 1 0







I won't ask why you chose such a strange axis alignment for your octagon vessel. The assumption of a diagonal inertia tensor is definitely not satisfied here, so you may get strange physics, but anyway, I guess that's not the point.

It looks like your parent attachment point is rotated by around 45 degrees in both x and y, so the (0,0,-1) direction is definitely wrong. It should instead be something like

[math]
\left(\begin{array}{ccc}
\cos b & 0 & -\sin b \\
0 & 1 & 0 \\
\sin b & 0 & \cos b
\end{array}\right)
\left(\begin{array}{ccc}
1 & 0 & 0 \\
0 & \cos a & -\sin a \\
0 & \sin a & \cos a
\end{array}\right)
\left(\begin{array}{c}
0 \\ 0 \\ 1
\end{array}\right)
[/math]
where a and b are the corresponding rotations (both around 45 degrees, from the looks of it). The rotation alignment vector needs to be rotated with the same transformation.

On the child vessel, the attachment direction is probably the usual (0,0,1), or whatever side you placed the attachment on.
 
SO the parent should be?

Code:
AE352= CreateAttachment (false,_V( -5.18, -2.2,  84.95),_V(.497468,.497468,1),_V(.497468,.497468,1),"AE352",false);//storage

Well, no. Now your direction and rotation vectors are identical. They must be orthogonal. They are also not normalised. You couldn't have got these values from the formula above.

Given your images, and creative application of signs to account for rotation directions, I would guesstimate

[1/2, 1/sqrt(2), 1/2] for the direction vector, and [-1/2,1/sqrt(2),-1/2] for the rotation vector (but that last one depends on how you had it aligned in the unrotated case. I was assuming [0 1 0], but you may have to adjust that. For example, it could also be [1/sqrt(2),0,-1/sqrt(2)], if your original vector was [1,0,0])
 
Thanks. So before normalised. 1/2 =.5 1/sqrt(2)=.7071068

(.5,.707,.5)-direction

(-.5,.707,-.5)-rotation

This is all for the parent, right?

Well, no. Now your direction and rotation vectors are identical. They must be orthogonal. They are also not normalised. You couldn't have got these values from the formula above.

Given your images, and creative application of signs to account for rotation directions, I would guesstimate

[1/2, 1/sqrt(2), 1/2] for the direction vector, and [-1/2,1/sqrt(2),-1/2] for the rotation vector (but that last one depends on how you had it aligned in the unrotated case. I was assuming [0 1 0], but you may have to adjust that. For example, it could also be [1/sqrt(2),0,-1/sqrt(2)], if your original vector was [1,0,0])
 
No.

Parent

Code:
AE352= CreateAttachment (false,_V( -5.18, -2.2,  84.95),_V(.5025,.7035,.5025),_V(-.5025,.7035,-.5025),"AE352",false);//storage

child

Code:
0 0 0.0  0 0 -1  0 1 0
vector4.jpg
 
Sorry, I can't make any sense of these images. If the positive parent y-axis is "up" in that image, and you have a nonzero y component in your attachment direction, I can't see how the child can be positioned the way it is. Are they Orbiter screenshots? Can you redo them with the vessel axes turned on, so I can at least see the local frame orientations of parent and child?

Also, you have some curious rounding errors in your values. .5025 is a poor approximation of 0.5, and .7035 is an equally poor approximation of sqrt(2). But that won't have caused the problem.
 
Hope this helps:
vector5.jpg


Because this is inside the ship I had to copy the axis. the red is the parent axis the grey the child
 
Afraid it doesn't. All I wanted was an Orbiter screenshot similar to the first image in your first post, showing the orientations of parent and child in their respective local frames. Why inside the ship? I thought the little cube was attached to the outside of the octagonal shape?

Never mind. Since we don't seem to get anywhere with manual rotations, here is another idea. Why don't you simply add two little unit length line segments to your mesh model of the ship, representing the attachment direction and rotation vectors. Make sure they look correct, then perform all your mesh manipulations including these vector representations, and at the end read out their values and stick them into your attachment definitions. That should be pretty foolproof. As long as they look visually correct, they can't be entirely wrong.
 
a bit confused. What if I just add that cube to the mesh and move it and change angle and get that info.


Inside. The octagon part is a hallway inside the ship and then that cube is attached inside the hallway

We may use UCGO and just when the cube is in the ship then show an angled one

---------- Post added 07-31-13 at 06:09 AM ---------- Previous post was 07-30-13 at 10:47 PM ----------

ok. I added the cube as a mesh and in meshwizard made the changes. I rotated 45 degrees in the x and y direction. So I get a vector of (-0.850128948971991,-0.52657456273521,0)

vector6.jpg

vector7.jpg


---------- Post added at 04:22 PM ---------- Previous post was at 06:09 AM ----------

Ok I have this but have a weird issue

Code:
AE352= CreateAttachment (false,_V( -5.18, -2.2,  84.95),_V(-0.850128948971991,-0.52657456273521,0),_V(0.850128948971991,0.52657456273521,0),"AE352",false);//storage
 
Ok I have this but have a weird issue

Code:
AE352= CreateAttachment (false,_V( -5.18, -2.2,  84.95),_V(-0.850128948971991,-0.52657456273521,0),_V(0.850128948971991,0.52657456273521,0),"AE352",false);//storage

I'm not surprised. The direction and rotation vectors must be orthogonal.

I'm afraid I won't be able to follow this up any further. I've given it my best shot. Maybe somebody else could assist?
 
Back
Top