VB6 : is possible convert radians to pixels?
the WindowViewe is 200 pixels.
so i need draw 200 lines between PlayerAngle(100 pixels) to 200. but how can i convert pixels to Radians... the PlayerAngle is the 100 pixel(the half of WindowViewe)
Private Sub rayCasting()
Dim rayAngle As Double
Dim IncreRayAngle As Double
Dim RayX As Double
Dim RayY As Double
Dim rayCos As Double
Dim raySin As Double
'CamWidth is the viewe width...
IncreRayAngle = DegreeToRadians(PlayerFOV) / CamWidth 'getting the angle step
'getting the player position to ray origin:
RayX = PlayerX * MapResolution
RayY = PlayerY * MapResolution
For rayAngle = PlayerAngle To 2 Step IncreRayAngle
'draw the line with 50 of lenght thinking on it's angle:
DrawLine Floor(RayX), Floor(RayY), Floor(RayX + Cos(rayAngle) * 50), Floor(RayY + Sin(rayAngle) * 50), vbRed
Next rayAngle
End Sub