## Math 3D: how rotate the 3D vectors?

how can i rotate the 3D axis?
i have these 2 functions(i must convert degrees to radians)(forget been VB6 code.. i just need rotate from player position):
Code:
```Private Function ConvertDegreesToRadians(Rotation As Angle3D) As Angle3D

End Function

Private Function Rotate(Position As Position3D, Rotation As Angle3D, PositionRotated As Position3D) As Position3D
Dim ConvertedPosition As Position3D

'Convert the actual position to zero or player position, using the rotation position:
ConvertedPosition = Position
ConvertedPosition.X = Position.X - PositionRotated.X
ConvertedPosition.Y = -(PositionRotated.Y - Position.Y)  'reversed because Y increments down
ConvertedPosition.Z = Position.Z - PositionRotated.Z

'Rotate the position, but the Z axis must be the 1st:
Dim T As Position3D

'Z axis  (Roll)
T = ConvertedPosition

'X axis  (Pitch)
T = ConvertedPosition

'Y axis  (Yaw)
T = ConvertedPosition

'Convert to the rotated original position:
ConvertedPosition.X = ConvertedPosition.X + PositionRotated.X
ConvertedPosition.Y = ConvertedPosition.Y + PositionRotated.Y
ConvertedPosition.Z = ConvertedPosition.Z + PositionRotated.Z

'Convert to Camera Coordinates\Position:
'ConvertedPosition.X = ConvertedPosition.X + camera1.Position.X
'ConvertedPosition.Y = ConvertedPosition.Y + camera1.Position.Y
'ConvertedPosition.Z = ConvertedPosition.Z + camera1.Position.Z

Rotate = ConvertedPosition
End Function```
when i do the rotation, some vectors can be much more far away and sometimes i get a wrong draw:
https://imgur.com/ZeV7Oii
is the rotation correct? i think that these calculation isn't correct