|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] flash 3d problem
Hi, I'm trying to make a 3d animation in Flash4 using only my programming skills :) I have run into a problem though... I have worked out the end points of a line I'm trying to draw on the screen. I can set the line object I've got at a point in space easily enough, but the only way to set the other end of the line to a certain point is to scale and rotate the line. Seeing as flash doesn't have any built in trig functions, my problem is that I can't work out the angle to rotate the line by give that all I know are x and y... and given that there is no sqrt function either. So, I have (x1, y1) and (x2, y2) and I need to know then angle between these (theta) as well as the length of the line. is there anyway to do this given the constraints that all that can be used are sin, cos, tan (with a lookup table I'm going to put into the animation) and no square root? I have considered putting in a table for atan, but I don't think it would work because of the way the indexing works in flash (with no real array support etc). of course, I guess I could just precalculate everything, but then I wouldn't be able to rotate stuff freely, eg if I have a box or some other 3d object and I let the user rotate it with the mouse. Any suggestions about how to accomplish 3d animation in flash either using what I've suggested or some other method would be greatly appreciated. Thanks, Paul Robson ================================================================= The GameProgrammer.Com mailing list is for the open discussion of any topic related to the art, science, and business of programming games. This list is especially tolerant of beginners. We were all beginners once To SUBSCRIBE or UNSUBSCRIBE please visit: http://gameprogrammer.com/mailinglist.html
|
|