[index]

Anton's Research Ramblings

29 June 2012

Talking Head Weighted Average

After doing some reading about complicated interpolation methods for morph target animations, I thought "Ah for goodness sake - this is going nowhere!" and wrote a very simple weighted average function. That fixed it. I had 2 targets as well as a kind of default shape that I was unconsciously intending to show up as the sum of the other targets was < 1.0. This was my hitch. I threw in a little clamp function to turn this into a sensible value, and tested it in my very handy shader editing demo. That worked:

Generic GLSL code

I updated my talking head demo with the new shader.

3D Picking with Rays

I want to implement a few different 3D picking algorithms and try them all; at least ray-casting based and colour-picking methods. I just finished coding up my 3D picking algorithm from the earlier journal entry. It seems to be working in my off-line test programme. Once again, a lot of misleading half-knowledge on the web, and lots of out-dated OpenGL 2.1 information that no longer applies. This older info was a handy reference to make sure that I was on the right track (the first part anyway). Need to try it in a 3D programme now;

C code using the glm maths library

The next step is to add in the ray vs sphere code to see if I can click on things. I plan to debug this part visually, so I have been building a function to display a renderable's bounding sphere as a semi-transparent mesh. If I can check against the bounding spheres with the ray, then perhaps change their colour when a hit is detected, it should be pretty easy to verify if the code is working properly and not giving false positives or false negatives.


I plan to render these blue spheres around each object. They are of unit size, so I should be able to scale each one based on the greatest (absolute) x, y, or z position value from each object's origin. If the spheres are too big and clumsy versus the shape and proximity of the objects, then we can also tell if we need a more precise algorithm

Next Week

I plan to get the 3D ray picking working with spheres, then implement a colour-based picking algorithm and compare the results. I'll get them both working in WebGL as well.