Page 1 of 1
How to read Object rotation entries in the wld file [Solved]
Posted: Fri Sep 15, 2006 7:19 pm
by Rends
Hi,
can anyone explain this object rotation entry in the wld file:
ChildRotation(0.710, 0.000, 0.704, 0.000)
Well this confuse me. The object was rotated 90 degrees (middlebutton) in Zeroeditor. So i thought the wld entry would have an entry like (90, 00, 00)
but in fact it has 4 entries and it doesn´t look like degrees ?
The reason why i ask is because even with snap rotation on Zeroeditor doesn´t rotate very exactly sometimes. so if i think it rotate 90 degrees it rotate 89,5 . But i need exactly 90.
Rends
RE: How to read Object rotation entries in the wld file
Posted: Fri Sep 15, 2006 8:54 pm
by t551
An object that is simply placed without rotation has values of 1, 0, 0 , 0 , so doubt that this is radians. Did you only rotate on one axis Rends?
RE: How to read Object rotation entries in the wld file
Posted: Sat Sep 16, 2006 7:05 am
by Rends
sure i rotate it z axis only but if you keep hold mouse button you will notice that the object starts to move very slowly after a while in varios directions so this might be the reason why it doesn´t end at 90 degrees exactly. Now i want to fix it by textediting but still don´t understand the 4 entries.
Rends
RE: How to read Object rotation entries in the wld file
Posted: Sat Sep 16, 2006 1:29 pm
by t551
No doubt it's some complex math that I haven't taken yet, but the values of 1 and -1 are important. 0,1,0,0 rotates the prop 180 degrees on the red circle (x? axis). 0, 0, 1, 0 rotates the prop 180 degrees on the blue (z axis). 0, 0, 0, 1 rotates the prop 180 degrees on the green (y? axis). 1, 0, 0 , 0 is the default, straight up, starting position. Using .5's in various positions, I can get the object to flop over. If you need to get an object to rotate 90 degrees on the z axis, I would say that 1.000, 0.000, 0.500, 0.000 would be a safe guess, but if that doesn't work, just insert .5's randomly.
If that doesn't work, meditate and fast until the solution appears before you in a hallucination.
RE: How to read Object rotation entries in the wld file
Posted: Sat Sep 16, 2006 4:13 pm
by FragMe!
t551t551 was close it is complex math it is a 3 dimensional trigonometry vector based relation (sin, cosine and tangent)
but near as I can figure is this the first 0 is common to all the second 0 relates to a rotation on the red axis, third 0 is blue axis
and last is green axis. If you want to do a 90 degree rotation on any one axis say blue the numbers would look like this
0.707,0,0.707,0 or 90 degrees negative would be 0.707,0,-0.707,0. a 180 degree rotation on blue axis would be 0,0,-1,0.
These numbers apply to all rotations the numbers just have to be put in the appropriate axis location mentioned above.
But basically 0.707 + or - is 90 (270) degrees for other angles the numbers will obviously different but I have been out
of school for a very long time and my trig isn't what it used to be.
Hope this helps
RE: How to read Object rotation entries in the wld file
Posted: Sat Sep 16, 2006 4:39 pm
by t551
Trig-- I know trig! Well, I don't know trigonometric vectors, but I do know some basic and intermediate trigonometry.But why the ***** would any sane person use that to define object rotation!!!!????
RE: How to read Object rotation entries in the wld file
Posted: Sat Sep 16, 2006 5:09 pm
by FragMe!
who said anyone at pandemic was sane

I just know by seeing it that .707 is the sin and cosine of 45 degrees
(darn my trig teacher for drilling that into my brain) so some how those two .707s (45 deg) relate to a 90 degree
resultant.
Remember math is pure reasoning isn't

RE: How to read Object rotation entries in the wld file
Posted: Sat Sep 16, 2006 5:13 pm
by t551
Hmm... Why 45 degrees? Half of 90... Maybe Pandemic decided to redefine math and work with a circle of only 180 degrees...
RE: How to read Object rotation entries in the wld file
Posted: Sat Sep 16, 2006 5:26 pm
by FragMe!
not sure but just checked a 45 degree rotation the numbers were 0.924,0,0.383,0
inverse cos 0f .924 = 22.5 degrees and inverse sin .383 = 22.5 degrees once again
half of 45
I would think on this more but I think I broke my brain I have only really delt with 2 dimension vectors
RE: How to read Object rotation entries in the wld file
Posted: Sat Sep 16, 2006 5:29 pm
by t551
So you halve the rotation angle, take the arcsine or arctangent of it, and enter the numbers?
RE: How to read Object rotation entries in the wld file
Posted: Sat Sep 16, 2006 7:11 pm
by FragMe!
As near as I can figure and this paticular example relates to blue rotation, yes half the angle you want to do
take the cosine of the number and put it in the first number location, then take the sine of the
of half the angle and put it in the third number loaction make sure to include the - sign if the
angle in question has one. This should also work for red and green rotation.
Oh by the way all bets are off if you want to calculate angles on two and or 3 planes of rotations at once.
A 90 degree blue and 90 degree green rotation generates these numbers 0.500, 0.500, 0.500, 0.500
But if you go cosine,sine,sine,sine it is 60,30,30,30

Ouch my brain hurts just thinking of it
RE: How to read Object rotation entries in the wld file
Posted: Sat Sep 16, 2006 8:07 pm
by t551
Well, Rends knows what he needs to know.