Point of axis rotation change

Posted By: Darkmatters

Point of axis rotation change - 04/14/10 16:05

I want to cange the angle of rotation for a cube, front lower edge when rotating forward, back lower edge when rotating backward,left lower edge when rotating left.. etc...
I can get it to rotate ok, but always from the middle, I need to specify where the axis point is??
Any help would be appreicated.
Posted By: Widi

Re: Point of axis rotation change - 04/14/10 16:24

vec_for_vertex();
Posted By: Darkmatters

Re: Point of axis rotation change - 04/14/10 16:31

that seems to be only a temporary thing, need something that is permanant??
Posted By: Widi

Re: Point of axis rotation change - 04/14/10 17:57

???
Posted By: Darkmatters

Re: Point of axis rotation change - 04/14/10 18:19

Well I have tried to get that to work, without much success?
Posted By: flits

Re: Point of axis rotation change - 04/14/10 19:55

i dont for sure whate you are doing but maby you can do it with bones

maby i litle more explanation whate you want (maby a image)
Posted By: Darkmatters

Re: Point of axis rotation change - 04/14/10 21:05


Ok, well imagine a cube, the surface on the floor has 4 sides, I want to tell it to rotate/flip on a particular side..

left flip
/-------------/
/ /
back flip / / forward flip
--------------
right flip

hope this makes sense to you!!!
Thanks
Posted By: Darkmatters

Re: Point of axis rotation change - 04/14/10 21:07


That was supposed to be a box..... :-)

...........leftflip
back../------------/
flip./............/
..../............/ forward flip
.../____________/
......rightflip

hope this works better.....
Posted By: Darkmatters

Re: Point of axis rotation change - 04/14/10 21:08

better, any way, if it still is a mystery, let me know where I can send a pic...

thanks
Posted By: MrGuest

Re: Point of axis rotation change - 04/15/10 13:42

hey, have a look at vec_rotate(direction,angle); should do what you need
Posted By: Henning

Re: Point of axis rotation change - 04/20/10 07:52

Hello, when I understand right, you want a cube rolling over the floor. You will need a combination of transformations and a rotation.
1. Define 4 vectors from the center of cube to the midpoints of the lower edges, i.e. vecToFront, vecToLeft...
2. Transform the center of cube to the midpoint of the desired rotation edge.
3. Rotate the cube (ent.pan...) and all four vectors by the desired angle (vec_rotate).
4. Transform the cube and vectors from the transformed tip of the midpoint vector to the center of the cube (example: vec_diff (lastTrans, cube.x, vecToLeft)).
Hope that helps.
Posted By: Darkmatters

Re: Point of axis rotation change - 04/20/10 09:30

That sounds about right, however, I am a noobie... so if you could give a little more explanation.....

Thanks for replying tho...

F.
© 2024 lite-C Forums