Just writing a little 3dMouse function which draws a quad where the mouse is, relative to camera and zoom. The mesh is setup in an Init Function, and works fine if I don't zoom the camera. In fact, I can see the mouse if I use a lower camzoom than the real value, but obviously it's out of it's depth. The camzoom# I'm using in my program is currently 2.5 and it works at 1.5 ( but wrong depth obviously ) so I figured it was a zorder problem. But I've got it set as -99 so it should be drawn first, no?
I'm using it in combination with FonText, but I don't think that's relevant as I can't see it elsewhere on the screen either. Any ideas what might be wrong?
Function Draw3dMouseRelative(cam,camzoom#)
mx=MouseX()
my=MouseY()
ClearSurface mousesurface
x1=mx-mousehw
x2=mx-mousehw+50
z1=mousehw*camzoom#
y1=mousehh-my
y2=mousehh-my-50
; TRANSFORMING OF POINTS
TFormPoint x1,y1,z1,cam,0
tx1=TFormedX#()
ty1=TFormedY#()
tz1=TFormedZ#()
TFormPoint x2,y1,z1,cam,0
tx2=TFormedX#()
ty2=TFormedY#()
tz2=TFormedZ#()
TFormPoint x2,y2,z1,cam,0
tx3=TFormedX#()
ty3=TFormedY#()
tz3=TFormedZ#()
TFormPoint x1,y2,z1,cam,0
tx4=TFormedX#()
ty4=TFormedY#()
tz4=TFormedZ#()
; ADD VERTICES
v1=AddVertex(mousesurface,tx1,ty1,tz1,0,0)
v2=AddVertex(mousesurface,tx2,ty2,tz2,1,0)
v3=AddVertex(mousesurface,tx3,ty3,tz3,1,1)
v4=AddVertex(mousesurface,tx4,ty4,tz4,0,1)
; ADD TRIANGLES
AddTriangle(mousesurface,v1,v2,v4)
AddTriangle(mousesurface,v2,v3,v4)
EntityOrder mousemesh,-99
End Function
I'm using it in combination with FonText, but I don't think that's relevant as I can't see it elsewhere on the screen either. Any ideas what might be wrong?
Function Draw3dMouseRelative(cam,camzoom#)
mx=MouseX()
my=MouseY()
ClearSurface mousesurface
x1=mx-mousehw
x2=mx-mousehw+50
z1=mousehw*camzoom#
y1=mousehh-my
y2=mousehh-my-50
; TRANSFORMING OF POINTS
TFormPoint x1,y1,z1,cam,0
tx1=TFormedX#()
ty1=TFormedY#()
tz1=TFormedZ#()
TFormPoint x2,y1,z1,cam,0
tx2=TFormedX#()
ty2=TFormedY#()
tz2=TFormedZ#()
TFormPoint x2,y2,z1,cam,0
tx3=TFormedX#()
ty3=TFormedY#()
tz3=TFormedZ#()
TFormPoint x1,y2,z1,cam,0
tx4=TFormedX#()
ty4=TFormedY#()
tz4=TFormedZ#()
; ADD VERTICES
v1=AddVertex(mousesurface,tx1,ty1,tz1,0,0)
v2=AddVertex(mousesurface,tx2,ty2,tz2,1,0)
v3=AddVertex(mousesurface,tx3,ty3,tz3,1,1)
v4=AddVertex(mousesurface,tx4,ty4,tz4,0,1)
; ADD TRIANGLES
AddTriangle(mousesurface,v1,v2,v4)
AddTriangle(mousesurface,v2,v3,v4)
EntityOrder mousemesh,-99
End Function