Jump to content

rotation around changing axes


j00ey

Recommended Posts

I wonder if anyone can give me a hand with a problem.

I'm trying to make a large grid of cubes [but for the purpose of figuring out how to do it, it could be one cube], 'walk' around - that is rotate around one edge which is flat on the ground, then rotate around another edge on the ground, then another. The cubes must be copied onto points that have attribs stored on them to do all the rotation and transformation - at present I'm figuring out all the direction of travel in a solver and storing a direction attribute [left, right, up, down], I want to use that to drive the rotations but I'm a bit stuck with. I presume I need to use orient as well as some translation but my matrix / quaternion maths isn't good enough yet.

The first stage is VEX but I've been trying to work out the rotation in VOPs.. eventually I want to convert it to VEX.

Attached is a movie to make it a bit clearer. The cubes shouldn't slide, they should rotate into the next position around one of their edges, then repeat.

Thanks

blocks_odforce.mp4

Link to comment
Share on other sites

@ Matt - thanks a lot. That's very nearly what I'm after. I ported your method into my scene and with a box it appears to be working fine but if I swap out the box for a file SOP you can see they actually flip every time they change direction [see attached mp4]. The way I thought I would need to do it was to use the orient attrib before copying but perhaps doing it with primintrinsics is adaptable somehow, I need to do some learning on that topic.

@ Edward. Thanks very much. Looks like a lot of useful information there, I will have a read and look through the files there. 

 

blocks_odforce_flip.mp4

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...