I'm trying to get the slope and rotation from a face that the user clicks on.
I created the attached code which was fine untill I realised that it gives the
wrong results if the selected face has a combination of slope and rotation.
Please help. This has been bugging me for ages!
on mouseDown me
mdl = sprite(me.spriteNum).camera.modelsUnderLoc(the mouseLoc - p_Origin,
rot = getRotationFromNormal(mdl[#isectNormal])
slp = getSlopeFromNormal(mdl[#isectNormal])
on getRotationFromNormal vNormal
tAngle = vNormal.angleBetween(vector(0,1,0))
if vNormal.x < 0 then
tAngle = 360 - tAngle
on getSlopeFromNormal vNormal
tAngle = ...