Opengl or similar things for Visual C#

Discussion in 'OT Technology' started by Murph, Nov 30, 2006.

  1. Murph

    Murph New Member

    Joined:
    Jun 18, 2003
    Messages:
    872
    Likes Received:
    0
    Location:
    Columbia, SC
    I'm constructing an eye tracking application where I need to make a rudimentary physics engine. I'm constrained to visual C# do to the API of the eyetracker. The engine is going to need some graphics, and the graphic capabilities of visual C# are not up to the task. I need a graphics library that can do transparency, rotation, scaling, etc basically all the cool stuff I can do with Opengl with texture mapping. However, I'm having trouble finding a good tutorial on how to use Opengl in visual C#. If anyone can provide a link, or suggest an alternative library, I'd be thankful.
     
  2. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    have you tried this library yet?
    http://csgl.sourceforge.net/

    I looked into it earlier this year when I was bidding on a project, but never ended up getting it. Looks like what you might need. Basically just a wrapper around OpenGL if you already know the OGL basics.

    I know you can also call up all the DirectX libs through C# as well, so that may also be an option.

    Finally, Ogre is a generic 3d API which doesn't care about OGL or DirectX, etc. Cool thing is, you can code your app against the Ogre API and end up using DX or OGL later on... I have not used the .NET version so I'm not sure how stable it is, but I have a production app running against the C++ libs, and the api just rocks. Lots of built in features like menu systems, particle engines, matrix/quaternion math, mesh imports and animation support, etc. Might be worth a look

    http://www.ogre3d.org/wiki/index.php/OgreDotNet
     
  3. Heinzanova

    Heinzanova OT Supporter

    Joined:
    Aug 11, 2003
    Messages:
    14,329
    Likes Received:
    30
    Location:
    Singapore, Singapore
    Honostly

    Do it in C++, and export it as DLLs...

    I dont know why you are restricted to C# if you NEED todo graphics?
     
  4. Murph

    Murph New Member

    Joined:
    Jun 18, 2003
    Messages:
    872
    Likes Received:
    0
    Location:
    Columbia, SC
    The eye tracker API, which gives me things like calibration, data collection, etc, is written for visual C#.
     
  5. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    If you use the new C++ compiler w/ managed extensions, you can reference .NET assemblies. Might be worth a shot, because I agree that the best way to do write anything in openGL or DX would be to do it in C++

    EDIT: But then again, i'm not sure how effecient the managed c++ is compared to non-managed
     
  6. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    How heavy is the 3d stuff going to be? Pretty simple? Or are you making a full blown app with complex models or heavy rendering, etc.
     
  7. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    My high school had one of these back in 1997 or so -- it was a special project in conjunction with the local genius' school. (Which I later attended. And almost failed out of.) Anyway, I mention that because, after I used the system a few times, I figured out a couple of points:

    1. The software needs to store a queue of the user's eye position at each sample time. The queue needs to be a couple of seconds long, and the actual mouse pointer position needs to be the average of the eye positions over the previous second or so. Create a setting to allow users with extra-twitchy eyes to extend the period of time used in the averaging process to get better stability, if they need to.

    2. Simply staring at the same thing (icon, button, whatever) for a few seconds in order to click on it is infuriating, though point #1 alleviates it somewhat. Instead, try to detect blinks that last longer than a tenth of a second and interpret those as clicks instead.
     
  8. piratepenguin

    piratepenguin New Member

    Joined:
    Jun 18, 2006
    Messages:
    1,067
    Likes Received:
    0
    Location:
    Ireland
    Cool. I was looking at how something like this might work before. Was gonna make a program that could've been exactly what you're making.... Are you gonna be releasing your source code?

    An interesting project I found: dasher (there's an eyetracking page there too). I found a dude's page where he built an eyetracker into a pair of glasses, and it was supposadly very reliable. Ripping I can't find it right now..

    I should probably put more thought into this for the future: http://slashdot.org/comments.pl?sid=185088&cid=15277716
    Tell your genius friends to use a button ;) They're not that hard to make either :mamoru:
     
  9. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    My genius friends were making a device to let quadruplegics and encephalitics use a computer. Buttons don't work under those conditions. :hahano:
     

Share This Page