Jump to content
Sign in to follow this  
dyei nightmare

rotating eyes without gimbal lock kinda problem?

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


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

Share this post

Link to post
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.   

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this