GL4Dummies
GL4Dummies copied to clipboard
OpenGL Teapot the return
@Marobax said 2020-02-04:
I wrote to @noalien, to remake the traditionnal "glut TeaPot" in GL4Dummies. It's right now to deprecated functionalities in lib
glut, rendering of the traditionnal l'Utah Teapot with plain faces and wired one.
@Marobax it's OK for me, @noalien ok for you? Will be better if "main decisions" are re-transcribed in issue for future bug-tracking/decision-follow-up emails and talks are sadly perishable if not archived on a mailling-list.
@darnuria This was one of the many projects suggested by @noalien during our email exchanges so i guess it's ok. I've already started working on it. Finding the original glut_teapot.c file (which surprisingly has a lil' typo in it !) in glut 3.7 (last version ever).
The main question i'm asking myself being how do i connect myself to this API. @noalien, is it better to create a whole new file dedicated to those two functions somewhere in GL4D/, probably in a file named gl4dTeapot.c, or is there a more suitable place?
I've already started working on it.
Oh, please make it online as a fork and open a PR would make review easier for us! ^_^
Don't mind about making mistakes, changing mind or whatever every human being is imperfect it's OK. If you did'nt plan to do malicious stuff. ;p
Moreover: we are here to help. ;)
Great idea @darnuria. I'm not doing it today, but i sure will. Probably next week. I'll keep you informed.
I added a document that specifies what is expected for gl4duTeapot : https://github.com/noalien/GL4Dummies/blob/master/docs/TODO_gl4dgTeapot.pdf
BEHOLD THE TEAPOT
https://user-images.githubusercontent.com/30313752/108976533-e9329180-7687-11eb-9640-bb8c5aab817b.mp4
Good start (0,0,0) seems to be a starting point Try with : glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
It was actually just a lack of a sizeof *data in a malloc somewhere. My data being a table of GLfloats, it's easy to understand why it only showed a quarter of my teapot (and why the vertices end up being at (0,0,0) !). I just corrected up. See for yourself :)
https://user-images.githubusercontent.com/30313752/109375969-6c8af780-78c1-11eb-8d49-14d0d3f6e76b.mp4
I'm kind of proud actually. I had to work basically blindly for three weeks. I could'nt see what i was doing and still managed to be one sizeof away from perfection on my first render ! :D
Sadly i've gone through multiple unexpected tribulations. I dont want to complain to much but the task wasn't easy. Everything seemed to work against me. I encountered multiple problems even from official models and i've grown tired of it. That was really upsetting seeing one week worth of work getting thrown because a well known library actually contained misaligned vertices.
Knowing this and the fact that i have to work on other projects, I won't be able to continue adding the spout/handle. This projet was meant to target multiple people so i guess it's normal, but I prefer to prevent. If someone wants to add it and has the guts to add hundreds of vertices, i have the perfect model i just made myself to do the work. Adding it with some tweaks to the texCoord should be enough.
Just ask and i will deliver ! I'm even willing to mentor a bit if needed ;)

Keep in mind that ideally the teapot should take advantage of the "mkRegularGrid *" functions and use a mesh generator based on surfaces of revolution. Good luck. https://github.com/noalien/GL4Dummies/blob/master/docs/TODO_gl4dgTeapot.pdf
Sorry, but i'm busy these times and I won't be able to implement such a thing :/ I hardly understand the mkRegularGrid() "pipeline" (SelectGeometryOptimization into DrawWithGeometryOptimization into GLDrawElements) and working on it would probably require me an other week (at best), which i can't afford.
Moreover your pdf emphasizes on the fact that i should implement the teapot like the cylinder and that's what I think I did. mkRegularGrid seem to be only used for geometries that use slices and rows like the torus, and unlike the teapot.
Besides, my teapot generation is already quite optimized, as much in terms of algorithmic complexity as in terms of execution time. It only require one single glDrawArrays() to be drawn while also using the revolution principle just like asked. Diving on it again while my mind is busy with so much things would probably only make me broke it ! D:
I'll see if I can free myself some time at the beginning of next month, but it is more likely that I will work on other projects. I'll keep you informed if it happens :)
@Marobax The message was not directly addressed to you, sorry :). I insisted for the "next one", who would take up the subject (to give the teapot an oriental look). On the other hand, I just wish you resize your teapot so that it would fit in a unit cube. Is it OK for you ?
Hello, we are three students who want to work on the Teapot, @Laozey @Bibi210 and myself. We have started to implement the main part of the Teapot and the cover based on the functions "mkSphereVerticesf" and "gl4dgGenSpheref". We obtain for the moment the result below, it seems to us that the calculations of the normals and the coordinates of textures must still be improved.
https://user-images.githubusercontent.com/58478614/155721747-6acaaddc-1e2c-4d9a-a249-b6cf25165d9c.mp4
We are currently implementing the use of Bézier curves in order to do the other parts of the Teapot or even to use them for what we have already done. For example, below, we place spheres on a Bézier curve defined by 6 points.

Nice beginning Good luck for the next steps !
@noalien shall we close it? (auto-triaging my own openned issues)
unfortunately no, the specifications given above (https://github.com/noalien/GL4Dummies/issues/30#issuecomment-787878179) are not satisfied.
@noalien shall we close it? (auto-triaging my own openned issues)