Math calculation in Papyrus

Post » Tue Aug 27, 2013 4:32 am

Hey guys first of all i was never very good at maths. English great, science great, colouring in great, but maths not so much.

So as you can imagine when i have to try complex calculations using things like sine that don't make sense it confuses me and i need some help lol.

Basically i have 2 points. In the ck they have an X, Y, Z position. I need to know what the angle between those two points is (it'll only be a couple of degrees), and set the rotation of an object accordingly. The objects are spawned via script, and I'm doing this to take into account the gradient of the ground.

I've looked at frostfall as chesko does some cool stuff, but i don't need anything as complicated. Although I will be using his method of shooting a projectile at the ground at a given position, in order to find out what the first object position will be.

Basically if the result is 10 degrees i want to rotate an object by 10 degrees vertically. Does anyone have the time and knowledge to help a fella out? :)
User avatar
Jeremy Kenney
 
Posts: 3293
Joined: Sun Aug 05, 2007 5:36 pm

Post » Tue Aug 27, 2013 6:08 am

Oooh I kinda like math and I might be able to help... but what do you mean by the angle between only two points?

Two points will just form a line so there is no angle between them.

[A]----------------[B]

Is there a third point, something like an origin to form two vectors? You can calculate an angle there.

[A] [B]

| /

| /

[O]

User avatar
Roanne Bardsley
 
Posts: 3414
Joined: Wed Nov 08, 2006 9:57 am


Return to V - Skyrim

cron