Cobradile Posted August 16 Report Posted August 16 (edited) I'm trying to project a 3D point to 2D to have sprites follow a model around in an SDK project based on the 3D demo. However, when I try to apply the code I get online to do so, nothing happens. When I print the values on screen, they're all over the place! Here's my code. xpos = cammatrix.xrite * crosshair.transform.xpos + cammatrix.yrite * crosshair.transform.ypos + cammatrix.zrite * crosshair.transform.zpos; ypos = cammatrix.xdown * crosshair.transform.xpos + cammatrix.ydown * crosshair.transform.ypos + cammatrix.zdown * crosshair.transform.zpos; screen_x_pos = ((long)xpos + CAMWIDTH) >> 14; screen_y_pos = ((long)ypos + CAMHEIGHT) >> 14; buf1_olist[1].bit.xpos = screen_x_pos; buf2_olist[1].bit.xpos = screen_x_pos; buf1_olist[1].bit.ypos = screen_y_pos; buf2_olist[1].bit.ypos = screen_y_pos; OLbldto(drawbuf ? buf2_olist : buf1_olist, drawbuf ? packed_olist2 : packed_olist1); (CAMWIDTH is 320, CAMHEIGHT is 240) I've been told that loadxpt.inc has code to do what I'm looking for. Does anyone here know how to get to that? What do I do? Edited August 16 by Cobradile DegasElite 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.