3D Racing Enemy rotation
#1
Posted 01 September 2011 - 09:33 PM
#2
Posted 02 September 2011 - 01:49 AM
Ok, do you want your enemy car to face forward on the path?
If you want the car to face the next point in the path, this may be difficult. but you could try:
direction=point_direction(path_get_x(path_positionprevious),path_get_y(path_positionprevious),path_get_x(path_position),path_get_y(path_position));This will set the direction to forward on the path.
also I believe this is a 2D question.
RobotiX
Edited by Buff-Robotix, 02 September 2011 - 01:51 AM.
#3
Posted 02 September 2011 - 02:34 PM
thx but doesn't work.Hi!
Ok, do you want your enemy car to face forward on the path?
If you want the car to face the next point in the path, this may be difficult. but you could try:direction=point_direction(path_get_x(path_positionprevious),path_get_y(path_positionprevious),path_get_x(path_position),path_get_y(path_position));This will set the direction to forward on the path.
also I believe this is a 2D question.
RobotiX
#4
Posted 02 September 2011 - 03:40 PM
d3d_transform_set_rotation_z(direction)If you're using other transformations as well, use add instead of set
#5
Posted 02 September 2011 - 10:12 PM
what do you mean? Because I am using this transformation for my characterTo rotate it in the moving direction, use this transformation:
d3d_transform_set_rotation_z(direction)If you're using other transformations as well, use add instead of set
#6
Posted 23 September 2011 - 07:11 AM
#7
Posted 09 October 2011 - 11:02 PM
d3d_transform_add_translation(0-x,0-y,0-z); d3d_transform_add_rotation_z(direction); d3d_transform_add_translation(x,y,z); d3d_model_draw(myModel,x,y,z,-1); d3d_transform_set_identity();that should work fine.
#8
Posted 10 October 2011 - 10:38 AM
To rotate it in the moving direction, use this transformation:
d3d_transform_set_rotation_z(direction)If you're using other transformations as well, use add instead of set
I 100% agree with u this is rite way for me
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











