< img id="ppic" src="http://xxx.yyy.com/Nice_Fish.gif"
onMouseOver="document.images.ppic.src=document.images.ppic.src" >
But what I'd really like to do is to turn the eyeball into a
floating sprite that follows the mouse....so the fish looks at
the mouse cursor, at whatever position the mouse happens to be,
upon mouseover.
You'd need to calculate a relative vector somehow, from the center
of the eyeball position to the current mouse position.
I think I remember how to do that from previous exmperiments
with OpenGL. In fact I think I know how to do the whole
thing with OpenGL, but I haven't got a clue how to do it with
javascript, in browser land.
Is this possible, with javascript?
How would I do it?
You can use the basic trig from these:
http://www.btinternet.com/~kurt.grigg/javascript/followingeyes/followingeyes.html
http://www.btinternet.com/~kurt.grigg/javascript/staticeyes/staticeyes.html
Tone.
Kien
whi...@montana-riverboats.com (while_1) wrote in message news:<9be1f7f8.04080...@posting.google.com>...
> I made a simple animated gif of a fish whose eyeball wiggles
> a few loops upon any mouseover:
>
> < img id="ppic" src="http://xxx.yyy.com/Nice_Fish.gif"
> onMouseOver="document.images.ppic.src=document.images.ppic.src" >
>
> But what I'd really like to do is to turn the eyeball into a
> floating sprite that follows the mouse....so the fish looks at
> the mouse cursor, at whatever position the mouse happens to be,
> upon mouseover.
>
...