Keyboard Mousebutton Replacement Utility (.NET)
23 Aug 2009- Download (executable + source)
This is a small Windows utility that emulates the left and right mousebuttons using the right Windows key and the right Alt key.
This is a small Windows utility that emulates the left and right mousebuttons using the right Windows key and the right Alt key.
Simulates the projection of shadows coming from a spotlight light source onto irregular surfaces. In the supplied example, an animated MD2 model (from Quake 2) is casting a shadow onto the inside of a sphere. Supported parameters include shadow color, alpha, blur, falloff and texture map size, as well as position, rotation and field of view. This evolves out of the previous projection test.
This version handles arbitrary rotations, field of view / focal length, and uses correct math; the previous example faked it somewhat, doing everything basically with 2D math (but why admit to that? :). I found it twice as difficult getting to this point compared to the version posted a few days ago. It turns out that when you want to rotate more than 90 degrees around the x-axis, it's good to make friends with quaternions, if only superficially.
There's still a lot that could be done right / better with this: backface culling (already tried and failed); frustrum culling; per-triangle alpha based on distance and angle to simulate light intensity; per-triangle focus/blur based on distance, maybe (but probably not); a more straightforward way to implement video; shadows... Basically, anything short of building a renderer-inside-a-renderer.
My goal here was to approximate the look of a video projection hitting a 'non-planar surface' or otherwise intersecting objects in a 3d scene.
The underlying logic wasn't too painful. The UV coordinates of each vertex are all that need to be solved for. There's a linear relationship between the position and orientation of the 'projector', and the world space position and UV coordinates of each vertex in the scene -- requiring just algebra, which is nice, because that's about all the math I know. JiglibFlash is being used for the physics action.
In its current implementation, the projector is limited to looking straight down the z-axis. I have a feeling that the most elegant approach for all this would be to extend Camera3D or to piggyback on top of the plumbing of the Papervision framework in some other way (apologies for the mixed metaphor). Should I develop the 'Projection Manager' to handle arbitrary projector orientation, I'll post the source along with an updated example.
This describes my approach to adding SEO to a Flash-based site, which is my online portfolio.
You can navigate the HTML 'back-end' pages starting from here.