aNewLyfe Posted December 11, 2010 Share Posted December 11, 2010 Hi, after 2 days i've gave up. Problem is: i want to move a node forward by a keypress for example W. Well, moving on x+, x- or z+, z- is done. But i want to move node to forward. (Where it looking, facing at) variables i got: node rotation, node speed, node x,y,z points. Tried something like: $NODE_X += (cos(($PI/360)*($NODE_YROTATION+90))*$MOVE_SPEED) $NODE_Z += (cos(($PI/360)*($NODE_YROTATION+90))*$MOVE_SPEED) bad idea? my math is FF btw. Really waiting 4 your help. ~ Every Living Thing is a Code Snippet of World Application ~ Link to comment Share on other sites More sharing options...
kaotkbliss Posted December 11, 2010 Share Posted December 11, 2010 (edited) you can create additional nodes (front, back left and right) that are too small to see. make them child nodes of the main node and when you movement key _ispressed() then set the main node position to the position of the front (back left or right) node $dll = DllOpen("user32.dll") If _IsPressed("57", $dll) Then;w $posf = _IrrGetNodeAbsolutePosition($FrontNode) _IrrSetNodePosition($node, $posf[0], $Pos[1], $posf[2]) ElseIf _IsPressed("53", $dll) Then;s $posb = _IrrGetNodeAbsolutePosition($BackNode) _IrrSetNodePosition($node, $posb[0], $Pos[1], $posb[2]) EndIf Edited December 11, 2010 by kaotkbliss 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
aNewLyfe Posted December 12, 2010 Author Share Posted December 12, 2010 you can create additional nodes (front, back left and right) that are too small to see. make them child nodes of the main node and when you movement key _ispressed() then set the main node position to the position of the front (back left or right) node $dll = DllOpen("user32.dll") If _IsPressed("57", $dll) Then;w $posf = _IrrGetNodeAbsolutePosition($FrontNode) _IrrSetNodePosition($node, $posf[0], $Pos[1], $posf[2]) ElseIf _IsPressed("53", $dll) Then;s $posb = _IrrGetNodeAbsolutePosition($BackNode) _IrrSetNodePosition($node, $posb[0], $Pos[1], $posb[2]) EndIf well tnx 4 reply and your time. But i've found the formula after 3 days ((Cos(direction degree * pi number / 180) * node movement speed)) ~ Every Living Thing is a Code Snippet of World Application ~ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now