fireguy109 Posted June 24, 2011 Share Posted June 24, 2011 (edited) I am working on a first person mod and I need to point the camera at a point exactly 200 units away from the player's car. I am using basic trig. :Label950953 0001: wait 0 ms0054: store_player $PLAYER_CHAR position_to $XPOS $YPOS $ZME00AA: store_car $TEMP position_to $764 $763 $ZPOS0009: $ZPOS += 1.002F9: unknown_car $TEMP unknown_sinus $XANGLE 02F8: unknown_car $TEMP unknown_cosine $YANGLE0174: $ZANGLE = car $TEMP z_angle0086: $XPOS2 = $XPOS0086: $YPOS2 = $YPOS // $800 is the car's z angle as well, defined elsewhere in the script:Label95095F2 0086: $ANGLE = $800 02F6: $802 = sine $8000011: $802 *= 200 // 200 is the hypotenuse0086: $XAXIS = $802 02F7: $803 = cosine $8000011: $803 *= 200 0086: $YAXIS = $8030059: $XPOS += $XAXIS // Add the x value to your current position0059: $YPOS += $YAXIS // Add the y value to your current position015F: set_camera_position $XPOS2 $YPOS2 $ZPOS $XANGLE $YANGLE $ZANGLE // Current x/y/z position and rotations- put it there0160: point_camera $XPOS $YPOS $ZPOS 2 //point it at the points defined 3/2 above0002: jump @Label950954 When the script is activated, the camera just points east (90 degrees) and does not rotate when the car does (it moves N/S/E/W though, without turning, like moving a tripod but not turning it). It appears this is the default for cameras, as when the camera is not pointing anywhere it points east. I would really like to find out a way to make this work right. Did I mess up my sine and cosine or is it something else? EDIT: I can use GTA III opcodes only, and this is SCM not CLEO. Edited June 24, 2011 by fireguy109 Link to comment Share on other sites More sharing options...
UNRATED69 Posted June 24, 2011 Share Posted June 24, 2011 Well, according to GTAG, you've got 02F9 and 02F8 mixed up. Link to comment Share on other sites More sharing options...
fireguy109 Posted June 24, 2011 Author Share Posted June 24, 2011 But all that does is get the x and y angles for the camera, so if the car flips the camera flips too, etc. Fixed that but the problem still appears. Link to comment Share on other sites More sharing options...
spaceeinstein Posted June 24, 2011 Share Posted June 24, 2011 Try converting the angles to radians. Link to comment Share on other sites More sharing options...
fireguy109 Posted June 24, 2011 Author Share Posted June 24, 2011 (edited) Nope, didn't work. EDIT: 0160: point_camera $XPOS $YPOS $ZPOS 2 I'm playing around with different values for where 2 is, in the hopes of finding a solution. Using this as a guide- http://www.gtaforums.com/index.php?showtop...0entry3915346 No luck so far with anything other than 1/2, and those don't fix it. Edited June 24, 2011 by fireguy109 Link to comment Share on other sites More sharing options...
DK22Pac Posted June 24, 2011 Share Posted June 24, 2011 Check this link Link to comment Share on other sites More sharing options...
fireguy109 Posted June 24, 2011 Author Share Posted June 24, 2011 Check thislink I was hoping to make my own. I guess I'll just open it up and see how they did it. Link to comment Share on other sites More sharing options...
DK22Pac Posted June 24, 2011 Share Posted June 24, 2011 Just wanted to show that there is an another way to do it. 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