Bloodsong Termagant Posted July 29, 2019 Share Posted July 29, 2019 so on my slope quest... i have two coordinates, one that is right below my avatar, and one that is about 2 meters ahead of it. these are raycast coordinates, shooting out from the avatar's center point. anyway, i have gotten the formula that the angle of the slope is Tan^-1 (slope). and slope = (z2 - z1)/ (x2 - x1). vector p1 = llList2Vector(res1, 1); vector p2 = llList2Vector(res2, 1); float angle = llPow(llTan( (p2.z - p1.z)/(p2.x - p1.x) ), -1); so tangent of the slope to the -1 power. i'm standing on a prim rotated at 45 degrees, and facing upslope. but the angle keeps coming out to tiny numbers like -0.41267. eh??? my brain is melted. https://www.quora.com/How-can-you-find-the-angle-of-line-by-using-its-slope if you're nuts, these are some of the readouts i got: Quote <209.548500, 46.837690, 52.863240> <210.040200, 45.872910, 53.828010> slope tester: The angle came out to -0.412608 degrees. yeah, i tried getting the normals, but... i don't think i can wrangle those into anything useful for my purposes. i'm trying to see if the avatar is walking up or down a slope, and how steep it is. the normal just gives me the angle of the prim surface, not any idea of which way im facing on it. Link to comment Share on other sites More sharing options...
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now