DirectX Not working in .NET FYI and Question

Element6

Well-known member
Joined
Feb 16, 2010
Messages
85
Programming Experience
5-10
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.

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
 
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.
I've never had this happen in .Net, DirectX works fine for me both on x64 and x86 there's no need to set it to x86 only.

Even if it is set to x86 only (the projects of mine that use Access databases have to be x86 cause of the Jet and Ace drivers) all the controls load fine.
 
I don't know really; all I know is that when I added the DirectX Reference in Visual Studio 2008 it failed to load the User Control. I had to research to find the x86 referencing; and I think I had some preinitalization problems that required me to turn off the Exceptions LoaderLock.

If you have any information that would be nice; but to fix the apps so it would run like I said; I had to x86 the platform and disable loader lock.
 
Back
Top