please a little help with the thing quoted...i really need it...The_dragon said:and another problem....
i am trying to get the vertical pitch of the camera(up-down),the actual angle of it,by doing this:
but it doesen't seems to work,because most of the time it return the value 0...enyone have eny ideea why?Code:(agent_get_look_position, pos1, ":agent_id"), (agent_get_position,pos2,":agent_id"), (get_angle_between_positions, ":vert_rot", pos1, pos2),
as far as i know,the agent position doesen't have the rotations around x and y axis(they are 0),only arownd z axis.
Might be wrong here, butThe_dragon said:as far as i know,the agent position doesn't have the rotations around x and y axis (they are 0), only around z axis.
get_angle_between_positions = 705 # (get_angle_between_positions, <destination_fixed_point>, <position_no_1>, <position_no_2>),
# Calculates angle between positions, using positions as vectors. Only rotation around Z axis is used. In other words, the function returns the difference between Z rotations of both positions.
So, if I'm right, you need the α angle on this ****ty picture below:The_dragon said:i am trying to get the vertical pitch of the camera(up-down),the actual angle of it
store_asin
Might be wrong here, but I'm pretty certain that agents' position should have rotations around X and Y. In the flying framework I've created, the SP version uses agent positions to make the player (or enemies) fly. However, it's just that the engine doesn't seem to support tilting of the agents, so while their position will be slanted, the agent himself will not.
Ah, well, thanks for clarifying that then. Fixed my incorrect statement above.The_dragon said:if you get the agent's position,and then set_spawn_pos to the agent pos,and then spawn an item(preferable spears or something long),the item will spawn without x and y rotations(it is paralel with the horizontal ground)
dunde said:I don't see any reason we can't use position_get_rotation_around_x to get the pitch.
Code:(agent_get_look_position, pos1, ":agent_id"), (position_get_rotation_around_x, ":pitch", pos1),
(agent_get_look_position, pos1, ":agent_id"),
(agent_get_position,pos2,":agent_id"),
(position_transform_position_to_local, pos3,pos2,pos1),
(position_get_rotation_around_x, ":pitch", pos3), [code]
But... but... trigonometry! Nooooo!dunde said:My mistake . In that case than we can use position_transform_position_to_local
Code:(agent_get_look_position, pos1, ":agent_id"), (agent_get_position,pos2,":agent_id"), (position_transform_position_to_local, pos3,pos2,pos1), (position_get_rotation_around_x, ":pitch", pos3), [code]