
Display 2D image data as 3D surface ...
Posted Tuesday, 1 June, 2010 - 13:10 by mandragora inHi guys,
after my problem with the glControl refresh (thanks to everybody for the help), I've another little (...) problem!
Is present OpenTK a method similar to the Matlab Surface(...) funcion?
The problem that I've is to diplay a 2D image as a 3D surface. So for example I would like to be able to represent a 2D depht image map as a surface.
is that possible?
If not what is the correct way to do that?
Thanks a lot in advance
Have a nice day
Ben


Comments
Re: Display 2D image data as 3D surface ...
Any screen shot ?
Re: Display 2D image data as 3D surface ...
Is present OpenTK a method similar to the Matlab Surface(...) funcion?
Hey, OpenTK is the OpenGL-Wrapper, not Paintx :-)
If not what is the correct way to do that?
As usual: read your image, go through the x-y-coords and use the z-value as height.
Have a look at http://nehe.gamedev.net, OpenGL Tutorial #34
Re: Display 2D image data as 3D surface ...
:-(
oppss!!!
Thanks a lot and please excuse me for the stupid question that I've posted and for all the other ones that I'll post :-)))
I was pretty sure that the correct way was to use the image values as the height of the surface, but I didn't know how to do that.
I'll have a look on the nehe tutorial and I'll post my results.
Thanks again for helping me!!!
Ben
Re: Display 2D image data as 3D surface ...
Hi,
I've found this on the OpenTK website ...
http://www.opentk.com/node/618
This is exactly what I need !!! :-)))
Thanks
Ben
Re: Display 2D image data as 3D surface ...
Hi All,
after reading the nehe tutorial and the one present in the OpenTK web site,
I've managed to .... get a light blue glControl !!! :-)))
here is the code that I'm using:
What I'm doing wrong this time? How do I set up the camera position?
Thanks a lot
Ben
Re: Display 2D image data as 3D surface ...
Hi All,
I've managed to display my height map here is the code that I'm using:
Could someone please exlain me the link between the following likes of code ?
Also I saw that the use of Glu.LookAt is deprecated, what I should use instead?
Thanks a lot for your help
Ben
Re: Display 2D image data as 3D surface ...
Could someone please exlain me the link between the following likes of code ?
Well, both points have to do with "Looking", but in my eyes this combination is uncommon. Where did you find it?
But I understand your question not correctly, ask again from another Lookat. ;-)
Also I saw that the use of Glu.LookAt is deprecated, what I should use instead?
Yes, it is, but simply use it.
If the successor is finished, you will hear it.
Btw: for understanding OpenGL, you should go through the NeHe-Lessions, from Lesson 2 on, not beginning in the middle. It will be your tool for years. ;-)
Re: Display 2D image data as 3D surface ...
The successor is OpenTK.Matrix4.LookAt, which can be used like this:
Re: Display 2D image data as 3D surface ...
Hi Hortus,
thanks for the reply.
Well, both points have to do with "Looking", but in my eyes this combination is uncommon. Where did you find it?
Well ... nowhere ! :-) I've just wrote them in order to make something appear in the glControl. I was just playing a bit :-)))
Hi Fiddler thanks a lot for the info about the new version of Glu.Lookat(...)
I'll have a look on the NeHe tutorials, and do some more experimentations and I'll post my results.
Thanks again for all of your help
Have a nice day
Ben
Re: Display 2D image data as 3D surface ...
The successor is ...
Yes. :-)
In my head, I was thinking about the project Successor.Glu. ;-)