Game Development Community

SetTransform acting up

by Don DuRousseau · in General Discussion · 09/26/2005 (3:10 pm) · 1 replies

I am moving a couple of objects around, and while they are moved to almost the right position, they are slightly off. I have a set of objects (picture and frame/background) that I'm moving into place, but it doesn't get the rotation quite right. Anyone have an idea as to why that was happening? Here's my code:

In my mission file:
new StaticShape(TestBG) {
position = "423.425 327.807 256.847";
rotation = "0 0 -1 63.81";
scale = "1 0.1 1";
dataBlock = "BlackBox";
};
new StaticShape(TestPic) {
position = "424.079 327.224 256.847";
rotation = "0 0 -1 63.81";
scale = "0.5 0.1 0.5";
dataBlock = "PBox1";
};

My setTransform code:
TestBG.setTransform("423.425 327.807 226.847 0 0 -1 63.81");
TestPic.setTransform("423.425 327.45 226.847 0 0 -1 63.81");

Resulting placement:
placement coordinates are on, but the rotation % is off by the same amount for both, almost 8%:
0 0 -1 56.0438

#1
02/28/2006 (2:09 pm)
The values are rounded for the trip to the client. That might explain the cause of your problem, but the rounding shouldnt be so dramatic.

Have you tried running it in the debugger to see what values are taken from the scripts?