Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
(1 ratings)
ApprovedYou can, but if you're looking for a screen mouse position, @moddiemads system is the superior one. If that's what you're looking for, you should ask him for a JASS version.can I have a jass version please ?

Omg thank you antares <3You can, but if you're looking for a screen mouse position, @moddiemads system is the superior one. If that's what you're looking for, you should ask him for a JASS version.![]()
Every day he's closer to the finish line by 50% of the current time, but he'll never get to 100%(which I'm sure he'll update any minute now)
With a fixed camera, fully zoomed in, these are the results I am getting in the test map:The function works for every camera angle and rotation. The frame not following is probably because of how the mouse natives work; the mouse position only updates when you move the mouse cursor, not when the camera moves. The frame can also not move into the widescreen area.



print(GetCameraField(CAMERA_FIELD_FIELD_OF_VIEW)) in Reforged and Classic graphics and see if it's different? I would do it, but I don't own Reforged.That’s interesting and indeed very confusing, also is there a way to detect if the player is using SD or HD graphics?The Field of View is in fact different in Reforged than it is in Classic (77° vs. 70°). I tested it with the Reforged field of view and I get an error, but it's actually the opposite of the direction of your error, so I'm even more confused now.
View attachment 490547
There is this library [vJASS] - Detect Reforged.That’s interesting and indeed very confusing, also is there a way to detect if the player is using SD or HD graphics?
Great, I was worried there were more parameters that are different about the Reforged camera!

I shared it to two people on hive dms because they know I use wurst and they do too, so the "conversion" is not really to Jass but to Wurst xD (sorry for confusion) so doubt it will be useful to shareNice, can you share it?
public function screen2WorldSynced(real x, real y, player whichPlayer) returns WorldIntersection
let pid = ensureCameraState(whichPlayer)
if pid < 0
return WorldIntersection(0., 0., 0., false)
let a = (x - 0.4) * scaleFactor[pid]
let b = (0.42625 - yCenterScreenShift[pid] - y) * scaleFactor[pid]
let denominator = safeSqrt(1. + a * a + b * b)
if denominator <= SQRT_EPSILON
return WorldIntersection(eyeX[pid], eyeY[pid], eyeZ[pid], false)
let nx = 1. / denominator
var ny = safeSqrt(1. - (1. + b * b) * nx * nx)
var nz = safeSqrt(1. - nx * nx - ny * ny)
if a > 0.
ny = -ny
if b < 0.
nz = -nz
let nxPrime = cosAttackCosRot[pid] * nx - sinRot[pid] * ny + sinAttackCosRot[pid] * nz
let nyPrime = cosAttackSinRot[pid] * nx + cosRot[pid] * ny + sinAttackSinRot[pid] * nz
let nzPrime = -sinAttack[pid] * nx + cosAttack[pid] * nz
if nzPrime.abs() < SQRT_EPSILON
return WorldIntersection(eyeX[pid], eyeY[pid], eyeZ[pid], false)
let terrainGuess = getTerrainZ(eyeX[pid], eyeY[pid])
var xGuess = eyeX[pid] + nxPrime * (eyeZ[pid] - terrainGuess) / nzPrime
var yGuess = eyeY[pid] + nyPrime * (eyeZ[pid] - terrainGuess) / nzPrime
var zWorld = getTerrainZ(xGuess, yGuess)
var deltaZ = zWorld - terrainGuess
var zGuess = zWorld
int i = 0
while (deltaZ > 1. or deltaZ < -1.) and i < 50
let zWorldOld = zWorld
let deltaZOld = deltaZ
xGuess = eyeX[pid] + nxPrime * (eyeZ[pid] - zGuess) / nzPrime
yGuess = eyeY[pid] + nyPrime * (eyeZ[pid] - zGuess) / nzPrime
zWorld = getTerrainZ(xGuess, yGuess)
deltaZ = zWorld - zGuess
if (deltaZOld - deltaZ).abs() < SQRT_EPSILON
return WorldIntersection(xGuess, yGuess, zWorld, false)
zGuess = (deltaZOld * zWorld - deltaZ * zWorldOld) / (deltaZOld - deltaZ)
i += 1
return WorldIntersection(xGuess, yGuess, zWorld, i < 50)
public class SyncedCamera
static player localPlayer = null
static boolean array ready
static real array eyeX
static real array eyeY
static real array eyeZ
static real array angleOfAttack
static real array rotation
static real array fieldOfView
static real array targetDistance
static function getIndex(player whichPlayer) returns int
return whichPlayer != null ? whichPlayer.getId() : -1
static function differenceExceeds(real currentValue, real storedValue) returns boolean
return realAbs(currentValue - storedValue) > EPSILON
static function onSync()
let data = BlzGetTriggerSyncData()
var parsedPlayerIndex = -1
var fieldIndex = 0
for string part in data.split(",")
if fieldIndex == 0
parsedPlayerIndex = part.toInt() - 1
else if parsedPlayerIndex >= 0 and parsedPlayerIndex < bj_MAX_PLAYER_SLOTS
switch fieldIndex
case 1
eyeX[parsedPlayerIndex] = part.toReal()
case 2
eyeY[parsedPlayerIndex] = part.toReal()
case 3
eyeZ[parsedPlayerIndex] = part.toReal()
case 4
angleOfAttack[parsedPlayerIndex] = part.toReal()
case 5
rotation[parsedPlayerIndex] = part.toReal()
case 6
fieldOfView[parsedPlayerIndex] = part.toReal()
case 7
targetDistance[parsedPlayerIndex] = part.toReal()
fieldIndex += 1
if parsedPlayerIndex >= 0 and parsedPlayerIndex < bj_MAX_PLAYER_SLOTS
ready[parsedPlayerIndex] = true


