Permalink
Browse files

add cursor lighting on main index

  • Loading branch information...
1 parent c78d719 commit 7932616b1f340fe7ea23413fde09c14325887ca6 @jlongster committed May 26, 2011
Showing with 14 additions and 1 deletion.
  1. +14 −1 index.js
View
@@ -88,12 +88,25 @@ $(function() {
// dom3d.current_renderer().use_matrix();
// dom3d.current_renderer().use_refs();
- //frame();
timer = start_loop();
//test();
bind_controls();
update_controls();
+ var canvas = $('#canvas')
+ $(window).mousemove(function(e) {
+ var pos = canvas.offset();
+ var screen = $v(e.pageX - pos.left, e.pageY - pos.top);
+ var target = dom3d.current_renderer().project3d(
+ screen,
+ -dom3d.current_eye()[Z] - 5.0,
+ dom3d.current_frustum()
+ );
+
+ target[Z] += dom3d.current_eye()[Z];
+ dom3d.current_light(vec_unit(target));
+ });
+
$('.render-options a').click(update_controls);
});

0 comments on commit 7932616

Please sign in to comment.