How can I get a vector type in C#?
Asked Answered
S

5

10

I want to use Vectors in a C# application I'm writing, sepcifically a Vector3.

What's the best way for me to get a Vector type without writing my own?

Sociable answered 31/1, 2009 at 19:55 Comment(0)
R
11

I used one in a POC that I found on CodeProject. It's not ideal, but it worked for our situation. At the time, however, it did not have a method to reflect a Vector3 about a given normal, but that may have changed since then.

If you don't mind using DirectX (some stay away from it for whatever reason), then there is a Vector3 type in that library as well.

Rena answered 31/1, 2009 at 19:57 Comment(0)
T
8

Well, there's a struct called Microsoft.DirectX.Vector3 if that's what you're looking for. You need to reference Microsoft.DirectX.dll to use it.

Truancy answered 31/1, 2009 at 19:58 Comment(0)
D
5

For completeness, there is also one in XNA: Microsoft.XNA.Framework.Vector3.

Sounds like something in dire need of consolidation.

Dudleyduds answered 22/3, 2010 at 20:59 Comment(0)
M
3

In WPF you have:

System.Windows.Media.Media3D.Vector3D

Martsen answered 22/3, 2010 at 20:48 Comment(0)
P
3

You should be able to use the vector classes in SlimDX: http://code.google.com/p/slimdx/

You could also pull out the vector/math classes from an open source XNA port like XNATouch: http://xnatouch.codeplex.com/

Paba answered 22/3, 2010 at 20:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.