Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fish eyeball vector

0 views
Skip to first unread message

while_1

unread,
Aug 9, 2004, 11:03:25 AM8/9/04
to
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?

Tony

unread,
Aug 9, 2004, 5:43:37 PM8/9/04
to

Sandy Pittendrigh

unread,
Aug 9, 2004, 6:07:52 PM8/9/04
to
...thank you!

Kien

unread,
Aug 9, 2004, 7:29:53 PM8/9/04
to
Hi,
I would suggest having the eye in 8 positions, Up,Down,L,R,UpL,UpR,DownL,DownR
Then replace the image with each position according to the mouse position
You can sense the mouse position using onmousemove capture
like here http://www.caoxuan.com/cxk/webart/goodies/shyobj.html

Kien

> 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.
>

...

0 new messages