Monday, September 9, 2013

Lines and Expressions

Short update today, yet another sick day.  Today was mostly some cleanup work. 

I have been working on a "thick line" class so I can draw lines that are more than a single pixel wide.  I'm basically taking a default 1m square plane and then doing the appropriate math to scale and rotate it so that it falls along the desired line, and then rotating it along that line so that it faces towards the camera.  Some shader tricks and I should be able to get a nice falloff at the edges.

I had this embedded in a game-side component, I thought it would be better to move it into a generic Line Component.  While doing that, I thought I would look into binding expressions to the component construction process.  At the moment I'm just using a simple type parser (vector, transform, float, string) to get the values from attribute files.  Using expressions would make it possible to do more complex math, and more importantly, reference variables so I don't have to change the same constant all over the place.

As far as referencing variables, at the moment I only have variables that are bound from C++.  I started on making it possible to declare variables more dynamically - for starters, declaring a bunch of global variables in an attribute file.  This isn't quite ready to go yet.

So, hopefully finish that off tomorrow if I'm feeling up to it.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.