Direction eyeball pointing
|
|
Arcane Clawtooth
5 By 5
Join date: 7 Jan 2008
Posts: 201
|
01-14-2008 01:05
Anyone know of a way to return the rotation of the avatar eyeballs? I can't seem to figure it out 
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
01-14-2008 06:38
I think that's pretty much impossible. The problem is that the sim's representation of the agent--all that's available to a script--has no notion of how the avatar is contorted by any animations. (The twist here is that the sim must know what the agent's viewer is looking at; for one thing, all other viewers see the avatar try to turn its eyes. But I know of no way that's exposed to scripts.)
You can of course know the agent's overall rotation (which is very roughly similar to the avatar's rotation in a viewer, if not distorted by "exotic" animations). And attachments can generate client-side effects (like particles) corresponding to the client-side rotation of the animated avatar's attachment points. But getting any relevant information into a script running on the server is, AFAIK, impossible.
|
|
Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
|
01-14-2008 09:39
heyas;
the problem is... once you attach something to the avatar (like on the eyes), the object doesnt move relative to its attachment point. i was trying to do something similar by attaching a sphere to the eyeball, and reading its rotations. which, guess what, never changed.
but... i wonder, do they change in global coordinates? and if you mathematize them with the avatar's rotational facing, could you get their local rotation? it's too much math for me, but if you figure it out, i'd love to know the code!!
--im speaking of things on the said avatar, that is. you want to calculate someone else's eyes... um, no.
_____________________
Why Johnny Can't Rotate: http://forums.secondlife.com/showthread.php?t=94705
|
|
Arcane Clawtooth
5 By 5
Join date: 7 Jan 2008
Posts: 201
|
01-14-2008 10:12
From: Bloodsong Termagant heyas;
the problem is... once you attach something to the avatar (like on the eyes), the object doesnt move relative to its attachment point. i was trying to do something similar by attaching a sphere to the eyeball, and reading its rotations. which, guess what, never changed. That's exactly what I was trying to do LOL  Wanted my furry's eyes to move like the human ones do. Oh well, I have another approach I'm going to try 
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
01-15-2008 01:38
uhm I thought objects attached to the eyes moved the same way the avs eyes did?
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
01-15-2008 02:48
From: Void Singer uhm I thought objects attached to the eyes moved the same way the avs eyes did? They do (or at least they render as such in the viewer), but there's no way to determine the viewer location from a script running on the server (as LSL scripts do). In fact, it is meaningless since the location may be somewhat different between different viewers rendering it simultaneously. It is no accident the LSL library doesn't give you a way to retrieve such information; it just isn't possible.
|
|
Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
|
01-21-2008 10:02
but...
can't an object ON THE EYE(s) in question get its current world facing? or are you guys saying they're not really moving? like that phantom target omega thing?
_____________________
Why Johnny Can't Rotate: http://forums.secondlife.com/showthread.php?t=94705
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
01-21-2008 11:09
From: Bloodsong Termagant can't an object ON THE EYE(s) in question get its current world facing? or are you guys saying they're not really moving? like that phantom target omega thing? You got it: like the llTargetOmega() thing for non-physical objects. Any attempt to get the position or rotation of an attached prim/object will either return those values for the whole avatar within the region, or for the object relative to the attach point (and since you have no idea how the attach point has been moved by animation, there's no way to tie that to the region coordinates).
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
01-21-2008 13:19
hmmm I wonder if this could be done with tracking the camera, give the eye attacments permissions to track the camera, script in some limits so the eyes don't roll into the back of the head, and you might be ok. since the eyes do track to the camera focus, the only hard part would be determining soft (head animation locked) and hard (head free) limits for the eyes. athough it might be hard to extrapolate the focus point, without another attachment on the camera position using a narrow sensor... even then it wouldn't account for transparent intevening objects.... ah well it was a thought
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
01-21-2008 13:54
Oh. It sounds like the original poster really just wants the attachments to move like the avatar's eyes. Simply attaching to the eyeballs does that. Heh heh. 
|
|
Arcane Clawtooth
5 By 5
Join date: 7 Jan 2008
Posts: 201
|
01-21-2008 22:21
From: Hewee Zetkin Oh. It sounds like the original poster really just wants the attachments to move like the avatar's eyes. Simply attaching to the eyeballs does that. Heh heh.  Actually, I wanted my furry's eyeballs to move like the human ones do. In the end I wrote a script to do the same, only better. Now you can command them to watch someone specific 
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
01-21-2008 22:38
Ah. Okay. Well, good deal. Glad it worked out. Sometimes SL's shortcomings can be inspirational. LOL
|