Click here to Skip to main content
15,881,882 members
Articles / Programming Languages / C#
Article

Sharp3D.Math - A 3D math library for .NET

Rate me:
Please Sign up or sign in to vote.
4.30/5 (32 votes)
9 Jun 20041 min read 223.2K   6.6K   79   51
A 3D math library written in C#

Introduction

I started building this library as part of a C# 3D engine I am currently working on. Having noticed that there isn't any decent open-source C# library for dealing with complex math out there I decided to focus my efforts on this library and release it to the world.

More information could be found on the project's workspace at http://workspaces.gotdotnet.com/sharp3d.

Features

  • Support both single-precision and double-precision floating point types.
  • Full-featured implementation of mathematical data types including complex numbers' quaternion and various sizes of matrices and vectors.
  • Geometric data types and algorithms for 2D and 3D - distance and intersection methods, bounding volumes etc.
  • Random number and noise generation.
  • Strong-Typed collections for the library's data types.
  • Extension of standard mathematical functions, such as Cos(), Sqrt(), and Exp(), to work with vectors, matrices, and complex number classes.
  • A support library for converting between DirectX and Sharp3D.Math structures.

History

  • v1.1.1621.25560 - Update
    • Added array lists for vector structures.
    • Added a Polygon class to the Geometry3D and Geometry2D namespaces.
    • Added a Triangle structure to the Geometry3D namespace.
    • Intersection Methods : Ray to plane, AABB, OBB, Triangle and Sphere (not fully implemented yet).
    • Intersection Methods between AABB, OBB and Sphere (not fully implemented yet).
    • Added <, > , <=, >= operators to the vector structures.
    • Added IIntegrator implementations : SimpsonIntegral.
    • Implemented the Parse method for vectors and complex numbers.
    • Created Sharp3D.Math.Tests library and moved all unit testing classes there so that Sharp3D.Math is no longer dependent on NUnit.Framework.dll.
  • v1.1 - First release.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Israel Israel
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralRe: Trash! while still got high scores, Cheater! Pin
Eran Kampf10-Jun-04 12:03
Eran Kampf10-Jun-04 12:03 
GeneralRe: Trash! while still got high scores, Cheater! Pin
123ert$@yahoo.com10-Jun-04 11:09
123ert$@yahoo.com10-Jun-04 11:09 
GeneralRe: Trash! while still got high scores, Cheater! Pin
Coskun Oba17-Jul-04 6:54
Coskun Oba17-Jul-04 6:54 
GeneralRe: Trash! while still got high scores, Cheater! Pin
Herbert Sauro28-Oct-04 7:58
Herbert Sauro28-Oct-04 7:58 
General3D Graph (Surface) Pin
Majid Shahabfar23-May-04 5:24
Majid Shahabfar23-May-04 5:24 
GeneralRe: 3D Graph (Surface) Pin
Eran Kampf23-May-04 6:47
Eran Kampf23-May-04 6:47 
GeneralRe: 3D Graph (Surface) Pin
Coskun Oba21-Jul-09 21:56
Coskun Oba21-Jul-09 21:56 
GeneralMatricies Pin
MichaelCoder20-May-04 12:17
MichaelCoder20-May-04 12:17 
How would you go about building a struct that you could set how many rows and columns you had? From what I see of this class, you have the choice of a 2x2, 3x3, or 4x4 matrix. What if you wanted a 3x6? What I'm getting at here is that you could have matrix A which has the size HxJ and you have matrix B which has the size TxR. You can still add/subtract/multiply/divide these matricies. I know for multiply A times B, it would have the size HxR. And if you multiplied B times A, it would have the size TxJ. I think this would cut down the repition of code between your classes, because you now don't care what size it is so you don't have to cast for each one.
GeneralRe: Matricies Pin
Eran Kampf21-May-04 3:12
Eran Kampf21-May-04 3:12 
GeneralRe: Matricies Pin
Coskun Oba25-May-04 20:46
Coskun Oba25-May-04 20:46 
GeneralRe: Matricies Pin
Eran Kampf25-May-04 22:12
Eran Kampf25-May-04 22:12 
QuestionDetails ? Pin
Jonathan de Halleux12-May-04 2:10
Jonathan de Halleux12-May-04 2:10 
AnswerRe: Details ? Pin
Eran Kampf13-May-04 21:23
Eran Kampf13-May-04 21:23 
GeneralRe: Details ? Pin
Jonathan de Halleux13-May-04 22:09
Jonathan de Halleux13-May-04 22:09 
GeneralRe: Details ? Pin
Jonathan de Halleux13-May-04 22:20
Jonathan de Halleux13-May-04 22:20 
GeneralRe: Details ? Pin
Eran Kampf14-May-04 0:47
Eran Kampf14-May-04 0:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.