Skip to main content
GameDev.net gamedev.net
🔒 Locked

How to get glu source code

Started by Kai Sharp Jul 25, 2007 at 9:10 AM 13 replies 16.2k views
Original Post
Kai Sharp
Kai Sharp
Is glu source code avaliable? Not understand how hight level Nurbs APIS connected with evaluator, I think maybe I need to take a look at the source code. Is OpenGL Open source? I didn't find the source code in OpenGL.org.
jpetrie
jpetrie
OpenGL is not open source (this is a common misconception). The code for the GL implementation you are probably using is not available.

That said, there are open-source implementation of the OGL spec. Look up Mesa 3D, or the source code to a Linux implementation of GL.
Neutrinohunter
Neutrinohunter
Try

http://www.koders.com/c/fid6A9086D4244A3B5B4E24C96CA892AC576F78BBBE.aspx

It has a few bits of code for a ps2 dev kit I think, shows how one could make gluLookAt in that link, but has a sidebar with all the various OpenGL functions.

Whether they are correct are not I cannot say though.

neutrinohunter
jpetrie
jpetrie
Er, that code is not relevant at all. 90% of it is a wrapper around what appears to be a PSP graphics library (I hope, for your sake, a legal one, I haven't bothered to check). And it doesn't contain any of the GLU curve evaluator functions.

(To the OP: Have you examined what the Red and Blue books have to say on the subject? You might not need to go source diving to find what you want)
V-man
V-man
http://mesa3d.org/, there is a link to GLU's source code o the left side.

If I were you, I would look elesewhere for a nicely optmized NURBS lib.
Kai Sharp
Kai Sharp
Quote:
Original post by Neutrinohunter
Try

http://www.koders.com/c/fid6A9086D4244A3B5B4E24C96CA892AC576F78BBBE.aspx

It has a few bits of code for a ps2 dev kit I think, shows how one could make gluLookAt in that link, but has a sidebar with all the various OpenGL functions.

Whether they are correct are not I cannot say though.

neutrinohunter


Thank you all the same. I do get some valuable code samples in Koders.com.
Kai Sharp
Kai Sharp
Quote:
Original post by jpetrie
Er, that code is not relevant at all. 90% of it is a wrapper around what appears to be a PSP graphics library (I hope, for your sake, a legal one, I haven't bothered to check). And it doesn't contain any of the GLU curve evaluator functions.

(To the OP: Have you examined what the Red and Blue books have to say on the subject? You might not need to go source diving to find what you want)


It's far better to get some reply, no matter what they are.
There is a search engine on that page, and I searched gluNurbsCurve and got a page of GLNurbs, there is a private variable named curveEvaluator.But I haven't get the detailed implement code yet.

Thank you!
Kai Sharp
Kai Sharp
Quote:
Original post by V-man
If I were you, I would look elesewhere for a nicely optmized NURBS lib.


Very great idea! Thanks a lot.

I'm a student , so I hope I could find some free lib.



swiftcoder
swiftcoder
I would really recommend rolling your own NURBS code. Firstly, NURBS are horrible when you don't understand the mechanics behind them, secondly GLU's doesn't do many things one typically needs with NURBS, and thirdly, GLU is a very strange beast that doesn't exist in all GL implementations (or at least is stuck with an old version) and seems to be on the verge of dying out.
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
swiftcoder
swiftcoder
Quote:
Original post by V-man
If I were you, I would look elesewhere for a nicely optmized NURBS lib.

And you may look a long time. I spent quite a while about a year and a half ago trying to find a nice NURBS library, coming to the conclusion that nobody was interested. There are quite a few implementations floating around (mostly tied to a particular processor family for optimisation), but very few 3rd party NURBS libraries, and almost none that support sufficient flexibility for most uses.
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
Kai Sharp
Kai Sharp
Quote:
Original post by swiftcoder
I would really recommend rolling your own NURBS code. Firstly, NURBS are horrible when you don't understand the mechanics behind them, secondly GLU's doesn't do many things one typically needs with NURBS, and thirdly, GLU is a very strange beast that doesn't exist in all GL implementations (or at least is stuck with an old version) and seems to be on the verge of dying out.


Horrible , they realy are.
I have finished "The NURBS Book" chapter 4, and the computation is really complicated. But I will only use order 4 or order 3 spline. Besides I don't need NURBS, I only need uniform B-spline. I will consider your advice, thank you sincerely.
Kai Sharp
Kai Sharp
Quote:
Original post by swiftcoder
Quote:
Original post by V-man
If I were you, I would look elesewhere for a nicely optmized NURBS lib.

And you may look a long time. I spent quite a while about a year and a half ago trying to find a nice NURBS library, coming to the conclusion that nobody was interested. There are quite a few implementations floating around (mostly tied to a particular processor family for optimisation), but very few 3rd party NURBS libraries, and almost none that support sufficient flexibility for most uses.


Then how do you get your problem done finally?
PlayerX
PlayerX
You can get the GLU source code and SGI's base OpenGL source-code here: http://oss.sgi.com/projects/ogl-sample/. You can browse the source code using the Source Tree link on the left.

SGI opened up the source code some time ago.
swiftcoder
swiftcoder
Quote:
Original post by Kai Sharp
Quote:
Original post by swiftcoder
Quote:
Original post by V-man
If I were you, I would look elesewhere for a nicely optmized NURBS lib.

And you may look a long time. I spent quite a while about a year and a half ago trying to find a nice NURBS library, coming to the conclusion that nobody was interested. There are quite a few implementations floating around (mostly tied to a particular processor family for optimisation), but very few 3rd party NURBS libraries, and almost none that support sufficient flexibility for most uses.


Then how do you get your problem done finally?


I rolled my own, after some fun times wrestling with the mathematics behind it. Not sure I ever quite sorted normal generation though - always a few degenerate normals coming out. I was working on CAD stuff, so I needed access to the produced mesh (not just the control points), and I also needed regular(?) subdivision - as opposed to screen-space. Maybe if this is just display code GL's implementation will work OK, but you may still need the mesh for collision detection.
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
Kai Sharp
Kai Sharp
Quote:
Original post by swiftcoder
I rolled my own, after some fun times wrestling with the mathematics behind it. Not sure I ever quite sorted normal generation though - always a few degenerate normals coming out. I was working on CAD stuff, so I needed access to the produced mesh (not just the control points), and I also needed regular(?) subdivision - as opposed to screen-space. Maybe if this is just display code GL's implementation will work OK, but you may still need the mesh for collision detection.


You did great job.
Thank you!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.