getCameraViewDirection – Talk
Killzone Kid (talk | contribs) No edit summary |
Killzone Kid (talk | contribs) No edit summary |
||
Line 19: | Line 19: | ||
Interesting. Looks like eyePos is wrong origin. try: | Interesting. Looks like eyePos is wrong origin. try: | ||
bob = player; | <code>bob = player; | ||
obj1 = createVehicle ["Land_RiceBox_F", position player, [], 0, "NONE"]; | obj1 = createVehicle ["Land_RiceBox_F", position player, [], 0, "NONE"]; | ||
obj2 = createVehicle ["Land_BottlePlastic_V2_F", position player, [], 0, "NONE"]; | obj2 = createVehicle ["Land_BottlePlastic_V2_F", position player, [], 0, "NONE"]; | ||
Line 33: | Line 33: | ||
obj3 setPosASL _endV; | obj3 setPosASL _endV; | ||
hintSilent (str worldToScreen (asltoagl _endV)); | hintSilent (str worldToScreen (asltoagl _endV)); | ||
}; | }; </code> | ||
[[User:Killzone Kid|Killzone Kid]] ([[User talk:Killzone Kid|talk]]) 01:39, 22 February 2016 (CET) | [[User:Killzone Kid|Killzone Kid]] ([[User talk:Killzone Kid|talk]]) 01:39, 22 February 2016 (CET) |
Revision as of 01:40, 22 February 2016
This does not represent the player's center of screen when looking around or aiming down sights --Benargee (talk) 01:17, 22 February 2016 (CET)
bob = player;
obj1 = createVehicle ["Land_RiceBox_F", position player, [], 0, "NONE"];
obj2 = createVehicle ["Land_BottlePlastic_V2_F", position player, [], 0, "NONE"];
obj3 = createVehicle ["Sign_Sphere10cm_F", position player, [], 0, "NONE"];
onEachFrame
{
_beg = eyePos bob;
_endE = (_beg vectorAdd (eyeDirection bob vectorMultiply 2));
obj1 setPosASL _endE;
_endW = (_beg vectorAdd (bob weaponDirection currentWeapon bob vectorMultiply 2));
obj2 setPosASL _endW;
_endV = (_beg vectorAdd (getCameraViewDirection bob vectorMultiply 2));
obj3 setPosASL _endV;
hintSilent (str worldToScreen (asltoagl _endV));
};
Interesting. Looks like eyePos is wrong origin. try:
bob = player;
obj1 = createVehicle ["Land_RiceBox_F", position player, [], 0, "NONE"];
obj2 = createVehicle ["Land_BottlePlastic_V2_F", position player, [], 0, "NONE"];
obj3 = createVehicle ["Sign_Sphere10cm_F", position player, [], 0, "NONE"];
onEachFrame
{
_beg = AGLtoASL positioncameratoworld [0,0,0];
_endE = (_beg vectorAdd (eyeDirection bob vectorMultiply 2));
obj1 setPosASL _endE;
_endW = (_beg vectorAdd (bob weaponDirection currentWeapon bob vectorMultiply 2));
obj2 setPosASL _endW;
_endV = (_beg vectorAdd (getCameraViewDirection bob vectorMultiply 2));
obj3 setPosASL _endV;
hintSilent (str worldToScreen (asltoagl _endV));
};
Killzone Kid (talk) 01:39, 22 February 2016 (CET)