Jump to content

rotating eyes without gimbal lock kinda problem?


dyei nightmare

Recommended Posts

whassap,  im trying to build a setup where you build a eye rotations, but the problem i find with is that rotate() which seems to be the more viable way,  presents 2 challenges when i try to use it:  

1.-  using the axis normally and rotating with radians:  i dont know how to do a smooth interpolations in the axis to turn the eye whichever i want. 

2.- using the axis to align the eye  so you  just playing around with radians: causes a snap effect, that reminds me the gimbal lock like issues, and thats the case of this example from @mestela

https://www.tokeru.com/cgwiki/index.php?title=File:Eyeball.hipnc

if you look each eye is "snapping" because the axis determines the orientation,  or im wrong?  

so do you know how to rotate at which ever direction with very smooth interpolation?   

  im trying this type of things: 

 


v@inidir = set(0,0,1); 
v@pt = point(1,"P",0); 
3@ident = ident();
3@secdir = dihedral(@inidir,@pt);
f@dist = 1-distance(@P,set(0,0,0)); 
3@sl = slerp( @ident, @secdir, @dist);
p@orient = quaternion(@sl); 
matrix xform;
@N = 0;
float scale = 1;
float postrotation = 0;
xform = instance( @P, @N, scale, postrotation, @orient, @pivot);
@P *= xform;








   as you can see in the code,  im trying to rotate with dihedral and with a falloff decay effect,  and then using instance to set up a pivot,  but this isnt working. 

this isnt giving the answer because dihedral() and lookat() by it self arent the full matrix set up, but then which one is the apropiate set up? 

and all this is not because the eye itself, but the eyelids,  basically the question is how do you setup eyelids in a procedural way?,  because they belong to the full mesh,  but have to be transformed with a very smooth falloff,  and im not using blend shapes because im not using skeletons,  is part of a procedural crowd.  

 

 

 

Edited by dyei nightmare
Link to comment
Share on other sites

the answer to this was:  the snapping is because it is being multiplied by 0 for a short period , so that causes a blank space where noise is not there,  but at first glance you could think it is because the axis shouldnt be controled like that,  and this is kinda the reason, but it can be a disipated a lot with diferent angle values.   

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...