Message Boards Message Boards

Rotatable 3D Spikey

Posted 11 years ago
Hello,

I found many spikeys whose shape changes with Manipulate on the demonstrations page, but I am looking to create a spikey whose shape does not change, but is rotatable.

For example there would be 4 sliders, one would rotate the spikey left-to-right, one would rotate the spikey right-to-left, one from top-to-bottom, and one from bottom-to-top.

The spikey can be any type of spikey that is 3-D.

I would greatly appreciate any and all help in acheiving this!

Thanks in Advance & Best Regards!
POSTED BY: Irfan Mir
6 Replies
I just posted about how to do something similar to this using the gyrometer in a Sphero robot (see the linked notebook), but I think this is similar to what you want.

 Manipulate[Dynamic[Graphics3D[{Yellow, Opacity[.8],
     Rotate[
      Rotate[
       Rotate[
        PolyhedronData["Spikey", "Faces"],
        roll, {0, 1, 0}],
       pitch, {1, 0, 0}],
      yaw, {0, 0, 1}]
     }]], {roll, 0, 2 Pi}, {pitch, 0, 2 Pi}, {yaw, 0, 2 Pi}]
POSTED BY: Phil Ngo
Yes, - Boxed -> False - adjusting Phil's code:
Manipulate[
Dynamic[Graphics3D[{Yellow, Opacity[.8],
    Rotate[Rotate[
      Rotate[PolyhedronData["Spikey", "Faces"], roll, {0, 1, 0}],
      pitch, {1, 0, 0}], yaw, {0, 0, 1}]}, Boxed -> False]], {roll, 0,
   2 Pi}, {pitch, 0, 2 Pi}, {yaw, 0, 2 Pi}]
POSTED BY: Vitaliy Kaurov
Thank you, this is exactly what I was looking for!
POSTED BY: Irfan Mir
A very nice answer from Phil! But I am just curious, - one can rotate 3D objects in Mathematica with mouse in arbitrary directions - like seen below. Why would you need sliders? - are you trying to stress specific directions of rotation?
PolyhedronData["Spikey"]

POSTED BY: Vitaliy Kaurov
Yes, it was a nice answer! Ah, yes. The purpose that I plan on using this, in the web and hopefully without a CDF plugin, requires it to be rotateable. And I thought the sliders may work on the web before the dragging does.

I am trying to stress right / clockwise on the x-z plane rotation. but not disable other rotations.

Is there a way I can get rid of the bounding-box?
POSTED BY: Irfan Mir
Thank you!
POSTED BY: Irfan Mir
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract