Eye thing that follows mouse

Post your own tutorials, guides and demos.

Post » Sun Nov 30, 2008 4:53 am



Techniqually this was a one event example until I decided I wanted to rave it up a bit by putting a gradient over the top which changes colour...

How it works: The eye is positioned at the mouse, then I work out the distance and angle between the mouse and the middle of the eye socket. I then divide the distance, and cap it to 32 pixels. Then I position the eye to the centre of the socket, and then move it by the distance and angle. Finally to add a bit of realism, I scale the eye down slightly by subtracting the distance from it, so it will become smaller as it leaves the centre (as eyes are spherical).

And thats about it :) I figured this might be useful if someone wanted to make eyes in a game which looked at things (for example, eyes on a portrait that look at the player...perhaps even the players eyes which look at the mouse in a mouse aim game...)

I'm wondering if this could be useful as a behaviour...just two actions 'set socket position' and 'look at'...then some tweaking variables that affect it. The intial position of it in the layout could be the default 'socket position' and then if you wanted to make eyes on a portrait that looked at the player you would just use a single action : 'look at player' :) So what are your thoughts?
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Sun Nov 30, 2008 6:05 am

really nice. im assuming some trial and error was required to get that eye to behave correctly? add some breathing to face for more humanlikeness. blinking maybe? (yes with that quality of graphic i know its pretty much out of the question for a small tech demo lol. but anyways, would make it cool.) this would be perfect for a tittle screen or cutscene. nice work man.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Sun Nov 30, 2008 8:52 am

Yeah that would be really cool for Myst kinda game.
I made something like that a while back in flash.
[url:23a018m8]http://img20.imageshack.us/my.php?image=myonewtgu9.swf&width=150[/url:23a018m8]
Ok not really like that, but it could be doable in Construct.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Sun Nov 30, 2008 7:39 pm

impressing
nothing more to say ;)
B
2
S
1
G
4
Posts: 114
Reputation: 1,528

Post » Mon Dec 01, 2008 1:44 am

I think making a behavior for it would be a great idea... mainly because it could be used and applied in a lot of other instances than just eyes. I can't test the thing here to see what it actually looks like since I'm st work and all, but I get the general idea and yeah... that would rock. :D

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Wed Dec 03, 2008 9:53 pm

That is really really freaky...lmao
B
13
S
3
G
5
Posts: 286
Reputation: 3,193


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests