Cilindro Generalizadfo


Para este trabalho, use cilindros generalizados e splines para modelar uma forma interessante. Para isto, deslize uma curva bidimensional (perpendicularmente) ao longo de um esqueleto (uma curva) definido por uma spline para gerar uma superficie. A forma final pode ser uma cobra, uma cadeia de caracteres formada por uma sequencia de macarroes, ou qualquer outra forma parecida com um tubo. Apos esta faze, voce deve fazer uma animacao com a forma gerada. Ou seja, mova-a no espaco, modifique a forma dela (isto seria muito interessante) fazendo uma camera virtual voar sobre ela. Esta animacao deve ser feita usando recusros so OpenGL e Linguagem C. Pense em movimentos interessantes que voce pode gerar. Pense tambem em quais texturas, sombreamento, ou outras caracteristicas de shading interessantes voce pode implementar.


Requerimentos


Dicas


Where to Start

    This section gives you a vague idea (just a suggestion) of how to go about doing all this stuff.

  1. Implement splines.  This is relatively simple plus you can write it and test it without needing any OpenGL (but you can do it however you like.)
  2. Implement Wireframe (by using the grid idea).  This requires a bit more work.  First you need to get your cross sectional curve that you will sweep along your skeleton curve.  After you have this, you will need to multiply the points by a rotation matrix to make the plane they lie on's normal the same as the spline normal.  Store these points and you you just need to add the GL_LINE_LOOP and you are ready for the next step.
  3. Implement skin.  This requires you to have step 2 complete.  To get the skin isn't much of a problem (just use the afformentioned GL_TRIANGLE_STRIP) the key is to fiddle with the normals and the lighting to make it look the way you want.
  4. Work on getting a nice shape to use for an animation and then all you have left is your animation.


More Optimizatoins

    This part tells you how you could speed up your code.

  1. Speeding up spline calculations: Forward Differencing.  See page 511 of Foley for more on that.  This is purely extra credit, but if you do it, you should definately tell us during the demo!
  2. Quaternions:  These aren't actually an optimization as such.  They are just another way of doing the Axis/Angle rotation required for sweeping a shape along a line.  The key to them is that they allow you to add Axis/Angle rotations easily.  They are more used for animation then just a singular rotation.  But, if you implement them correctly, show us and it will be extra credit.

Examples and Ideas for Generalized Cylinders

These first few are simple but boring: Much more interesting:

Some Extra Ideas


Other Info on Generalized Cylinders