TallgeeseIV Posted December 13, 2010 Share Posted December 13, 2010 I'm trying to figure out the equation to use to change a number from a starting point of 45 to an endpoint of 0, based on another number being between 0 and 90. basically when the second number is 0, the first number needs to be 45, when the second number is 45, the first number needs to be 22.5 and when the second number is 90, the first number needs to be 0, and everything in between. this is for a wscript i'm writing but the rest of the script isn't important right now, just need this equation. i'm apparently terrible at math because i've been working on this literally all week with no luck, and i'm sure it's something basic that i'm just too dumb to know off the top of my head. Link to comment Share on other sites More sharing options...
simplywayne90 Posted December 13, 2010 Share Posted December 13, 2010 I'm trying to figure out the equation to use to change a number from a starting point of 45 to an endpoint of 0, based on another number being between 0 and 90. basically when the second number is 0, the first number needs to be 45, when the second number is 45, the first number needs to be 22.5 and when the second number is 90, the first number needs to be 0, and everything in between. this is for a wscript i'm writing but the rest of the script isn't important right now, just need this equation. i'm apparently terrible at math because i've been working on this literally all week with no luck, and i'm sure it's something basic that i'm just too dumb to know off the top of my head. I have no idea what that means TallGeese, however, I remember you were doing something with objects earlier, maybe the feng shuei mod could have an answer. I really have no idea and may be talking out of the thing three feet below my head however. Link to comment Share on other sites More sharing options...
HugePinball Posted December 13, 2010 Share Posted December 13, 2010 Don't worry TallGeese, I haven't forgotten about your problem, I just don't have a complete answer for you yet. You've discovered as I did a while back, that rotational calculations are much more complicated than you might at first suspect. I'm going to follow up in your original thread because there's a much more complete explanation of what you're trying to do there already. Link to comment Share on other sites More sharing options...
TallgeeseIV Posted December 13, 2010 Author Share Posted December 13, 2010 Don't worry TallGeese, I haven't forgotten about your problem, I just don't have a complete answer for you yet. You've discovered as I did a while back, that rotational calculations are much more complicated than you might at first suspect. I'm going to follow up in your original thread because there's a much more complete explanation of what you're trying to do there already. Ah, that sounds good. I tried it several different ways now and i felt the other thread might be confusing. i started a new approach so i made a new thread for it. i did check out feng shui and it didn't have any answers for me. in feng shui you still rotate objects on the world axis, not sideways from the player's heading, unfortunately. and you're absolutely right, this is the hardest time i've ever had with a script. Link to comment Share on other sites More sharing options...
_frost_ Posted December 13, 2010 Share Posted December 13, 2010 (edited) X= first numberY= second number X= (90-Y):2Y= 90-x*2 doesn't work if Y=90 => 0 : 2gap-solution:(X= (91-Y):2-0.5 _frost_ Edited December 13, 2010 by _frost_ Link to comment Share on other sites More sharing options...
rickerhk Posted December 14, 2010 Share Posted December 14, 2010 I'm trying to figure out the equation to use to change a number from a starting point of 45 to an endpoint of 0, based on another number being between 0 and 90. basically when the second number is 0, the first number needs to be 45, when the second number is 45, the first number needs to be 22.5 and when the second number is 90, the first number needs to be 0, and everything in between. this is for a wscript i'm writing but the rest of the script isn't important right now, just need this equation. i'm apparently terrible at math because i've been working on this literally all week with no luck, and i'm sure it's something basic that i'm just too dumb to know off the top of my head. If X is 45 when Y is 0and X is 0 when Y is 90ThenX = 45 - (Y / 2) Link to comment Share on other sites More sharing options...
HugePinball Posted December 14, 2010 Share Posted December 14, 2010 Sorry guys, but his post at the top doesn't communicate what he's looking for at all. We're actually trying to calculate Euler rotations. A more complete discussion started here that we've since taken to PM. ;) Link to comment Share on other sites More sharing options...
Recommended Posts