redmarstrd 10 Posted February 27, 2016 Hello, I have been breaking my head over a certain set of variables in the mission.sqm, generated by the Eden 3D editor. What i am trying to figure out is to what the "angle" array actually has for values. Doesn't seen to be degrees. Maybe radians? I have no idea at the moment. In the editor I have rotation values like x:356.795 y:305.726 z:3.890 . Here is what i have found in the mission.sqm: class Entities { items = 22; class Item0 { dataType = "Object"; class PositionInfo { position[] = {4904.0103,336.05936,21883.053}; angles[] = {6.227246,5.3359337,0.06789292}; <-------------------- }; side = "Empty"; class Attributes{}; id = 19; type = "Land_BagBunker_Small_F"; }; What i am trying to do is to extract this information and use "createvehicle" in a script serverside. I gotten as far as extracting the "position" part, but the "angles" part are values that seem to be different from the usual "degrees" that you find in the 3d editor itself. Does someone have an idea how to convert these angles[] = {6.227246,5.3359337,0.06789292}; values to values that i can use with setVectordir ? Or maybe has a better idea for getting 3D editor information in a servside solution? cheers, Redd Share this post Link to post Share on other sites
redmarstrd 10 Posted February 27, 2016 Apparently it is in radians indeed. I should have seen it when the factor between the degrees and unknown was about 57.3... Share this post Link to post Share on other sites
pedeathtrian 100 Posted February 28, 2016 Most likely they are radians for yaw, pitch and roll/bank. Check Example 1 for setVectorDirAndUp command. Don't forget deg/rad conversion for trigonometric functions. Share this post Link to post Share on other sites
soolie 189 Posted February 28, 2016 Try this. https://forums.bistudio.com/topic/151465-gid-object-positioning-system/ Share this post Link to post Share on other sites
redmarstrd 10 Posted February 28, 2016 Thank you for the replies. I will try these out :) Share this post Link to post Share on other sites
elchupy 3 Posted November 24, 2017 Hi, did you find a solution to this, i m having some hard time trying to do the same thing. this is what i should see : And this is what i got : Code used (this comes from the refactored LARS composition spawn script, but instead of composition, it uses mission.sqm) : _cfgRot params["_P", "_Y", "_R"]; _Y = deg _Y; _P = deg _P; _R = 360 - (deg _R); { private _deg = call compile format [ "%1 mod 360", _x ]; if ( _deg < 0 ) then { _deg = linearConversion[ -0, -360, _deg, 360, 0 ]; }; call compile format[ "%1 = _deg", _x ]; } forEach [ "_P", "_R", "_Y" ]; if ( _debug ) then { diag_log format["%1 => yawl: %2, pitch: %3, roll: %4", _color, _Y, _P, _R]; }; private _dir = [sin _Y * cos _P, cos _Y * cos _P, sin _P]; private _up = [[sin _R, -sin _P, cos _R * cos _P], -_Y] call BIS_fnc_rotateVector2D; _obj setVectorDirAndUp [_dir, _up]; debug returned : 17:46:46 "blue => yawl: 180, pitch: 315, roll: 0" 17:46:46 "green => yawl: 0, pitch: 45, roll: 0" 17:46:46 "red => yawl: 270, pitch: 0, roll: 315" 17:46:46 "yellow => yawl: 90, pitch: 0, roll: 45" Share this post Link to post Share on other sites
elchupy 3 Posted November 25, 2017 found the solution : _cfgRot params["_P", "_Y", "_R"]; _Y = deg _Y; _P = 360 - (deg _P); _R = 360 - (deg _R); { private _deg = call compile format [ "%1 mod 360", _x ]; if ( _deg < 0 ) then { _deg = linearConversion[ -0, -360, _deg, 360, 0 ]; }; call compile format[ "%1 = _deg", _x ]; } forEach [ "_P", "_R", "_Y" ]; private _up = [sin _R, -sin _P, cos _R * cos _P]; _obj setDir _Y; _obj setVectorUp _up; 2 1 Share this post Link to post Share on other sites