getCameraViewDirection – Talk
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<code>" to "<code style="display: block">") |
Lou Montana (talk | contribs) m (Text replacement - "Killzone Kid" to "Killzone_Kid") |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
This does not represent the player's center of screen when looking around or aiming down sights --[[User:Benargee|Benargee]] ([[User talk:Benargee|talk]]) 01:17, 22 February 2016 (CET) | This does not represent the player's center of screen when looking around or aiming down sights --[[User:Benargee|Benargee]] ([[User talk:Benargee|talk]]) 01:17, 22 February 2016 (CET) | ||
< | <sqf> | ||
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 13: | Line 14: | ||
_endV = (_beg vectorAdd (getCameraViewDirection bob vectorMultiply 2)); | _endV = (_beg vectorAdd (getCameraViewDirection bob vectorMultiply 2)); | ||
obj3 setPosASL _endV; | obj3 setPosASL _endV; | ||
hintSilent (str worldToScreen ( | hintSilent (str worldToScreen (ASLToAGL _endV)); | ||
}; | }; | ||
</ | </sqf> | ||
Interesting. Looks like eyePos is wrong origin. try: | Interesting. Looks like eyePos is wrong origin. try: | ||
< | <sqf> | ||
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 25: | Line 27: | ||
onEachFrame | onEachFrame | ||
{ | { | ||
_beg = | _beg = AGLToASL positionCameraToWorld [0,0,0]; | ||
_endE = (_beg vectorAdd (eyeDirection bob vectorMultiply 2)); | _endE = (_beg vectorAdd (eyeDirection bob vectorMultiply 2)); | ||
obj1 setPosASL _endE; | obj1 setPosASL _endE; | ||
Line 32: | Line 34: | ||
_endV = (_beg vectorAdd (getCameraViewDirection bob vectorMultiply 2)); | _endV = (_beg vectorAdd (getCameraViewDirection bob vectorMultiply 2)); | ||
obj3 setPosASL _endV; | obj3 setPosASL _endV; | ||
hintSilent (str worldToScreen ( | hintSilent (str worldToScreen (ASLToAGL _endV)); | ||
}; </ | }; | ||
[[User: | </sqf> | ||
[[User:Killzone_Kid|Killzone_Kid]] ([[User talk:Killzone_Kid|talk]]) 01:39, 22 February 2016 (CET) |
Latest revision as of 13:48, 12 March 2024
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)