I need a function that takes parameters: camerax,cameray,cameraz,camerasect,camerahoriz,cameraang, screenx,screeny (xd,yd) and return x,y,z in build coordinates.

Can somebody help with programming such functions for non classic modes?

pan = tofloat( get("camera","pan") );
tilt = tofloat( get("camera","tilt") );
fov = tofloat( get("camera","fov") );
w = tofloat( get( "applet", "width" ) );
h = tofloat( get( "applet", "height" ) );
x = tofloat( x );
y = tofloat( y );
r = (sqrt(w*w + h*h) / 2.0) / tan( gradToRad(fov/2.0) );
vx = r; vy = w/2.0 - x; vz = h/2.0 - y;
pan = gradToRad( pan ); tilt = gradToRad( -tilt );
cosp = cos( pan ); sinp = sin( pan );
cost = cos( tilt ); sint = sin( tilt );
/*My * Mz*/
vx2 = vx*cost*cosp - vy*sinp + vz*cosp*sint;
vy2 = vx*cost*sinp + vy*cosp + vz*sint*sinp;
vz2 = -vx*sint + vz*cost;
sinRes = vy2 / sqrt(vx2*vx2 + vy2*vy2);
panRes = radToGrad( asin(sinRes) );
if( vx2 <= 0 && vy2 > 0 )
panRes = 180 - panRes;
else if( vx2 < 0 && vy2 <= 0 )
panRes = -180 - panRes;
sinRes = vz2 / sqrt(vx2*vx2 + vy2*vy2 + vz2*vz2);
tiltRes = radToGrad( asin(sinRes) );
Fox, on 01 March 2016 - 12:35 AM, said:
This post has been edited by Mr. Alias Nameless: 01 March 2016 - 05:06 AM
Fox, on 01 March 2016 - 05:21 AM, said:
Mr. Alias Nameless, on 01 March 2016 - 06:17 AM, said:
Fox, on 01 March 2016 - 07:47 AM, said:
Trooper Dan, on 01 March 2016 - 09:49 AM, said:
This post has been edited by Trooper Dan: 07 March 2016 - 02:05 PM
gamevar screenx 0 0
gamevar screeny 0 0
defstate menuwhatever
getuserdef .m_origin_x screenx
getuserdef .m_origin_y screeny
ifvare current_menu 110 // MENU_SKILL
{
// use screentext with the <<16 bit set, and *add* the coordinates you want to draw to screenx/y so it animates with the menu
}
ends
onevent EVENT_DISPLAYMENUREST
state menuwhatever
endevent
onevent EVENT_DISPLAYINACTIVEMENUREST
state menuwhatever
endevent
gamevar screenx 0 0
gamevar screeny 0 0
defstate menuwhatever
getuserdef .m_origin_x screenx
getuserdef .m_origin_y screeny
ifvare RETURN 110 // MENU_SKILL
{
// use screentext with the <<16 bit set, and *add* the coordinates you want to draw to screenx/y so it animates with the menu
}
ends
onevent EVENT_DISPLAYMENUREST
state menuwhatever
endevent
onevent EVENT_DISPLAYINACTIVEMENUREST
state menuwhatever
endevent
Fox, on 18 March 2016 - 03:43 PM, said:
Fox, on 18 March 2016 - 06:06 PM, said:
This post has been edited by Jblade: 18 March 2016 - 11:58 PM
This post has been edited by Fox: 19 March 2016 - 12:07 AM
ifactor RIFLESHELL
{
move FORWARD
getactor[THISACTOR].ang TEMP
subvar TEMP -412
randvar TEMP2 128
addvarvar TEMP TEMP2
setactor[THISACTOR].ang TEMP
}
move FORWARD
getactor[THISACTOR].ang TEMP
subvar TEMP -412
randvar TEMP2 128
addvarvar TEMP TEMP2
setactor[THISACTOR].ang TEMP
getactor[THISACTOR].owner TEMP8
setvarvar TEMP3 sprite[TEMP8].x
addvar TEMP3 256
getactor[TEMP8].ang TEMP4
addvar TEMP4 128
rotatepoint sprite[TEMP8].x sprite[TEMP8].y TEMP3 sprite[TEMP8].y TEMP4 TEMP5 TEMP6
setactor[THISACTOR].x TEMP5
setactor[THISACTOR].y TEMP6
getactor[TEMP8].z TEMP
subvar TEMP 8096
ifspawnedby APLAYER
{
getplayer[THISACTOR].horiz TEMP2
subvar TEMP2 100
mulvar TEMP2 16
subvarvar TEMP TEMP2
}
setactor[THISACTOR].z TEMPThis post has been edited by Jblade: 29 April 2016 - 12:35 PM
Mr. Alias Nameless, on 21 February 2016 - 06:35 AM, said:

This post has been edited by Mr. Alias Nameless: 12 August 2016 - 02:23 AM
Mblackwell, on 12 August 2016 - 12:46 PM, said:
This post has been edited by Mr. Alias Nameless: 15 August 2016 - 11:47 PM
sound SOMETHINGHITFORCE spawn TRANSPORTERSTAR spritepal 7
This post has been edited by stumppy84: 18 August 2016 - 05:20 PM