CodeBase - Mouse Look and Strafing
Category: Basic 3D
Uploaded: 7th Oct 2003 17:55
Modified: 8th Oct 2003 11:11
Basic FPS mouse look, WASD movement and strafing for beginners.
Simple Explanation:<br /> <br /> if keystate(17)=1<br /> x# = newxvalue(x#,wrapvalue(camera angle y()),1)<br /> z# = newzvalue(z#,wrapvalue(camera angle y()),1)<br /> endif<br /> <br /> The number 17 represents the "scancode" of the keyboard key "w".<br /> The keystate command will return a "1" if the key is currently being pressed.<br /> x# and z# represent the camera's position in the 3D world.<br /> The newx and newz value commands will find new co-ordinates in a 3D space based on the infomation passed into the command.<br /> so the above basically means:<br /> newcamera postion = new value(current position, direction, distance to travel)<br /> Similar to mathematical vectors but with none of the working out :)
No comments yet.