[IronPython] Direct3D demo

william william at resolversystems.com
Fri Oct 27 19:55:38 CEST 2006


For reference, this was what I needed to do to get GravityDemo working with the october DirectX SDK.

pwn3d:~/Shared-XP william$ diff old new
diff old/GravityDemo.py new/GravityDemo.py
34c34
<                 distSquared = direction.LengthSquared()
---
>                 distSquared = direction.LengthSq()
81,83c81,82
<             pos.X /= l-1
<             pos.Y /= l-1
<             pos.Z /= l-1
---
>             lM1 = l - 1
>             pos = DirectX.Vector3(pos.X/lM1, pos.Y/lM1, pos.Z/lM1)
diff old/framework.py new/framework.py
24,26c24,28
< clr.AddReferenceByPartialName("System.Drawing")
< clr.AddReferenceByPartialName("System.Windows.Forms")
< clr.AddReferenceByPartialName("Microsoft.DirectX")
---
> clr.AddReference("System.Drawing")
> clr.AddReference("System.Windows.Forms")
> clr.AddReference("Microsoft.DirectX")
> clr.AddReference("Microsoft.DirectX.Direct3D")
> clr.AddReference("Microsoft.DirectX.Direct3DX")
35c37,38
< from Microsoft.DirectX import Direct3D
---
> import Microsoft.DirectX.Direct3D as Direct3D
> 
189c192
<         self.LookAtMatrix = DirectX.Matrix.LookAtLeftHanded(zero, direction, up)
---
>         self.LookAtMatrix = DirectX.Matrix.LookAtLH(zero, direction, up)
250c253
<         color = DirectX.ColorValue.FromColor(color)
---
>         color = Direct3D.ColorValue.FromColor(color)
406c409
<             params.IsWindowed = True
---
>             params.Windowed = True
411c414
<             self.Device = Direct3D.Device(0, Direct3D.DeviceType.Hardware, handle,
---
>             self.Device = Direct3D.Device(0, Direct3D.DeviceType.Reference, handle,
416,417c419,420
<             self.Device.Transform.Projection = DirectX.Matrix.PerspectiveFieldOfViewLeftHanded(System.Math.PI/4.0, 1, 1, 100)
<             self.Device.Transform.View = DirectX.Matrix.LookAtLeftHanded(DirectX.Vector3(0, 3, -5), DirectX.Vector3(0, 0, 0), DirectX.Vector3(0, 1, 0))
---
>             self.Device.Transform.Projection = DirectX.Matrix.PerspectiveFovLH(System.Math.PI/4.0, 1, 1, 100)
>             self.Device.Transform.View = DirectX.Matrix.LookAtLH(DirectX.Vector3(0, 3, -5), DirectX.Vector3(0, 0, 0), DirectX.Vector3(0, 1, 0))
pwn3d:~/Shared-XP william$ 

On Fri, 27 Oct 2006 16:14:05 +0100, Giles Thomas <giles.thomas at resolversystems.com> wrote:
> Hi,
> 
> Is there going to be an updated version of the Direct3D demo now that
> the DirectX SDK to which it points has expired?
> 
> 
> Regards,
> 
> Giles
> 
> --
> Giles Thomas
> Resolver Systems
> giles.thomas at resolversystems.com
> 
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com




More information about the Ironpython-users mailing list