I decided to add some 3D rendering to my project and found an interesting little quirk. DirectX doesn't like to work under the AnyCPU Platform; it won't run. Instead you have to assign it to a new platform x86 under the Configuration Manager; which makes debugging difficult because if your doing User Controls they won't load.
Off subject; I have a camera in DirectX which I am looking at an object and I wanted to rotate the camera around the object; I am using the following Mathematics but it doesn't appear to want to work - instead it does a figure 8 pattern and I am not sure why. Can anyone look at this and see what I am not doing correctly? All the angle measurements are radian.
Off subject; I have a camera in DirectX which I am looking at an object and I wanted to rotate the camera around the object; I am using the following Mathematics but it doesn't appear to want to work - instead it does a figure 8 pattern and I am not sure why. Can anyone look at this and see what I am not doing correctly? All the angle measurements are radian.
VB.NET:
Public Function CartesianFromSpherical(ByVal Rho As Single, ByVal Phi As Single, ByVal Theta As Single) As Microsoft.DirectX.Vector3
' Rho = Distance From Target
' Phi = Angle of Ascension
' Theta = Angle of Declination
Return New Microsoft.DirectX.Vector3(Rho * Math.Sin(Phi) * Math.Cos(Theta), Rho * Math.Sin(Phi) * Math.Sin(Theta), Rho * Math.Cos(Phi))
End Function