Posts tagged with 'rendering'

The importance of great literature

  • Posted on September 3, 2012 at 11:30 am
Implicit Representation of Parametric Curves and Surfaces

Implicit Representation of Parametric Curves and Surfaces

I’ve recently been working on the question of whether mathematical surfaces can be rendered entirely using Shaders in a resolution-independent way, by avoiding the need to simplify the curve using triangles first. As part of the research in to this I found myself reading Sederberg, Anderson and Goldman’s 1984 paper “Implicit Representation of Parametric Curves and Surfaces” (available from ScienceDirect). Although not a new paper by computing standards, it’s definitely one of the best papers I’ve read in a long time, and goes to show that previous work is important not just from a legacy perspective.

It’s not just the contemporary relevance of the paper that demonstrates this point, but also its content. As the authors explain at the end of the paper, they present “two important examples of problems deemed unsolvable in the CAD literature, which are, in fact, solvable using century-old theorems.”

I’m not sure why I’ve been quite so surprised by this; I’m sure most people will consider this obvious. I should also add that Sederberg is very well cited in the rasterisation literature. However, it’s nice to come across such a clear example of less recent research that remains essential (and enjoyable) reading today.

I recommend the paper if you’ve not already read it. It’s very well written and contains some fascinating but clearly explained work.

Spherical co-ordinates

  • Posted on June 8, 2009 at 9:00 pm
Function using spherical co-ordinates

Function using spherical co-ordinates

So far Functy has worked only using Cartesian co-ordinates, but I’m currently working on code for the next release to allow functions to be defined using spherical co-ordinates too.

Spherical function plotting is already working as you can see in the screenshot. It seems to produce some nice effects that are quite different from those you generally get using Cartesian functions.

The tricky part seems to be getting the code for both co-ordinate types integrated nicely together, and also sorting out a suitable user interface to allow them both to be added seamlessly.

The reason the code is turning out to be tricky is that I’m trying to develop using object oriented techniques, but using C rather than C++. I know it’s perfectly possible to do this (and do it well; although not necessarily by me!), and so far there hasn’t been much problem. However, I’m now in a situation where inheritance would seem to be the perfect technique to use. Most of the methods needed for the two co-ordinate systems are the same, so in C++ it would make sense to use some virtual interfaces to define them and inherit these from a generic function type. Unfortunately I’m not sure if this is going to work well in C.

It seems like a silly thing to get stuck on and it would be nice to get the spherical functionality into the next build. I’m hoping the best method will become clearer as things progress.

Functy through the browser?

  • Posted on May 23, 2009 at 2:18 pm

Google recently announced the release of their O3D plugin and web API for creating 3D web graphics. As various commentators have pointed out this isn’t the first or only attempt to create a 3D web standard. I remember many years ago being excited by VRML and the prospect of adding 3D content to the Web. I was especially excited when at the time a colleague brought in a fantastic VRML rendition of the inside of Tutankhamun’s Tomb that he’d created, all running inside a browser. The Web could be so much more with 3D, and while I’ve not looked at the detail to say whether Google’s attempt is better than the others, it’s probably true that Google is more likely to push it hard enough to make it work. It’ll be a shame though if it lives only as a plugin, a kind of purgatory of integration inside the browser but removed from the rest of the page.

Google O3D vertex shader example

Google O3D vertex shader example

Along with the plugin Google also released some nice looking demos, and one in particular cought my eye: this vertex shader example. Here they apparently use a vertex shader to set the normal vertices of an animated 3D sine wave. It would be great to do something similar with Functy. At present the normals in Functy are generated using the Symbolic library in C, which can require quite some computing power for a complicated function using many vertices. If this could be handed over to the graphics card it could result in a real speedup and the possibility for much more accurate function plotting.

Unfortunately I don’t know enough about vertex shaders. But the nice thing about O3D is that all of the code is there in the Web page, so I’m hoping a bit of playing around with the examples, and some reading up about OpenGL could be a step in the right direction.

Top