Help with Turrets

TanGO

Spaceman
I need to put some slanted turrets on a model conversion to SO engine.
I'm using turrets.exe and I'll reach until put a 90 degree angle fine.
The problem is when I try slanted rather than a 90 degrees.
When I modify the parameters to slant it the turret also is "as twisted" then it seem can not calculate well the shot position (shoot to any place far of rhe player)

Somebody can explain what's exactly the Vector1, Direction, and Vector3?

Also I try with collsphr.exe on button to "rotation calculation" but this only request "X Axis" three times.

If someone any time has this problem and know how do it please post here. :)

Thanks!
 
When placing turrets, the easiest way is to look into meshes that have turrets in a similar postion.

Vector 1, Direction and Vector 3 are used to position the turret model itself, so it wont always be faing up.
 
ASommers (or some other guy from Origin... I don't remember for sure, since it was a few years ago) once posted in this forum some info about how hardpoints work. To save you the trouble of searching for his post, here's what he said:

A hardpoint is a named 3x4 matrix of 12 32-bit floats, in the order X.x, X.y, X.z, Y.x, Y.y, Y.z, Z.x, Z.y, Z.z, pos.x, pos.y, pos.z. The left-handed coordinate system is used, with positive x to the right, positive y up, and 'looking' along positive z. A transform at the origin would be:
1,0,0
0,1,0
0,0,1
0,0,0
A transform looking to the right, 5 meters to the right of the center of the object would be:
0,0,-1
0,1,0
1,0,0
5,0,0
The X, Y, and Z vectors must be normalized vectors. With non-axis-aligned rotations, things will be easier for you, otherwise you'll have to get out your calculator...
 
Thanks Quarto, I still don't know but maybe if anyone know about mathematics rotations that could be:

Rot X axis:
1 0 0 0
0 cos(aX) sen(aX) 0
0 -sen(aX) cos(aX) 0
0 0 0 1

Rot Y Axis:
Cos(aY) 0 -sen(aY) 0
0 1 0 0
sen(aY) 0 cos(aY) 0
0 0 0 1

Rot Z Axis:
Cos(aZ) sin(aZ) 0 0
-sen(aZ) cos(aZ) 0 0
0 0 1 0
0 0 0 1

That's right and applicable to calculate?
 
Err, well, probably :p. I'm a bit too tired to think, so I can't say for sure.

BTW, one thing that Eder's noticed is that you can also alter the size of a turret by reducing all those numbers by the right percentage - so, if you wanted a turret to be half of its full size, you would use 0.5 instead of 1. Mind you, this doesn't work too great (for some reason, the turrets frequently disappear and reappear when they or the player moves), but it can still be quite useful sometimes.
 
Yes, I noticed that of disappear and reappear when the angle is not assigned rightly.
On those turrets where I assigned a "suppose" angle I noticed that they were twisted and I don't knew why, now how you say they are resized I can undertand.
Anyway, on you last post you write on that article where talks about of "normalized vectors", my last post was extracted from a mathmatics site talking of rotations and I'll test that. I'll publsh the math resolution if I can understand it. :)
 
Well I have checked the math formulas and that work fine.

If in the furure somebody search help with turrets here I post how they work and how hardpoints have to set:

Rot X axis:
1 0 0
0 cos(aX) sen(aX)
0 -sen(aX) cos(aX)

Rot Y Axis:
Cos(aY) 0 -sen(aY)
0 1 0
sen(aY) 0 cos(aY)

Rot Z Axis:
Cos(aZ) sin(aZ) 0
-sen(aZ) cos(aZ) 0
0 0 1
 
Hmm, Tango, do you think we can make the resized turrets stop disappearing if we use more accurate values or something? That is a really annoying bug. :(
 
Yes, I have tested proportional view reductions, that's a same value on the three dimensions and this work.
I whish add to this thread some that I discover yesterday on inclined turrets:
When you use non-orthogonal rotations using the mentioned formulas of sin and cos, also we could resize multiply the final cos and sin values by a constant.
In second place, and this is very important on non-orthogonal rotations, we will must to look the rotation of the hardpoint of the base turret. If you simply rotate the base using sin and cos and forget the hardpoint of the turret, the turret shot calculation will never impact the enemy because the shot calculation is on a otrhogonal base. Now, to solve that I tested rotate the hardpoint of the turret inversely to turret rotation and this work fine! :). I'm talking about that hardpoint into the turret base who load the barrel mesh.
Yes, I know, you need many meshes change-hardpoint-turrets as inclinations you have on a ship, but it's simplex, you copy a existent turret and only change the hardpoint rotation values.

Continuing with the values to change the scale, I noticed in some cases that turret could "flash" to 1:1 scale again, specially when they shot, considering that bug only is a "flash", that's a small bug I think.
 
Back
Top