![]() |
Vector Trigonometry...
1 Attachment(s)
This is what I came up with for making a circle without sine or cosine. To me the script looks like its a bit too long for what needs to be done (not talking about relative to using sin and cosine), so I'd appreciate if someone could point out a simpler way to do this. Either way, I'll be able to use this in future scripts to alleviate cpu usage so I'm rather happy. Umm... *runs back to AS*
|
Works nicely. However, with such abbreviated variables, some comments would be nice. I can only make guesses at your thought process as is.
Tomorrow I will see what I can do. |
*digs out his old trig book*
Hmm.. Yes yes.. Now to try to understand what you just did there. |
oops, forgot how hard it is to understand any script without any kind of help;
r - radius px - pointx py - pointy seg - segment length (parts of a tile or something...) ^ edit those to change the effects dx - x dist from center to point dy - y dist from center to point c - vector length from center to point uc - altered vector length (makes seg usefull) pdx - dist I want to move point x pdy - dist I want to move point y pndx - new dist for point y pndy - ^ same for x nc - new radius unc - altered new radius (keep the radius the same) pnx - new point x pny - new point y basically i'm finding the tangent to the current vector, then changing the vector without altering the radius |
kai posted something that didn't require sin/cos besides for like 2 vars he created using it...I think I have it somewhere...
NPC Code: I might've edited it myself a little bit but oh well |
Quote:
|
ask and you shall recieve :p
|
| All times are GMT +2. The time now is 02:00 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.