W
while_1
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.
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?
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.
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?