Message Boards Message Boards

Trying to rotate 3D Plot (using Rotate and ImageRotate)

Posted 9 years ago
4 Replies
Posted 8 years ago

Hello,

Rotate works on graphics primitives (Sphere, Cylinder, Cuboid ...). ListContourPlot3D is not a graphics primitive.

In 3D, Rotate can rotate around any given 3D vector. Check this:

 Manipulate[
   Show[
     Graphics3D@Sphere[],
     Graphics3D@Rotate[Cuboid[], angle, {1, 0, 0}],
     PlotRange -> {{-1.5, 1.5}, {-1.5, 1.5}, {-1.5, 1.5}}
   ],
   {{angle, 0}, -\[Pi], \[Pi]}
 ]
POSTED BY: Hans Milton
Posted 8 years ago

Hi there All, I have a related problem, but first I would like to say to @Rajiv Krishnakumar, Mathematica is already answering part of your question and is asking you to give only a 2D vector, or pair of numbers, although the help of the rotate function states that you can give a 3D Vector, it is confusing. I have not discovered yet how to use the Rotate and the Show function for a 3D Graphic, can anyone tell me how to Rotate a 3D Graphic and the combine the rotated Graphic with other 3D Graphics? .

Graph1 = ListContourPlot3D[ Table[x^2 + y^2 - z^2 + RandomReal[0.1], {x, -2, 2, 0.2}, {y, -2, 2, 0.2}, {z, -2, 2, 0.2}], Contours -> {0}, Mesh -> None] Head[Graph1]= Graphic3D

If Rotate is used Esta= Rotate[Graph1, Pi/2] the Head of the Output gets changed to rotate Head[Esta] = Rotate and the rotated Graphic can NOT be combined with other Graphics with Show. The conversion to Graphic with Show is also not possible and delives the "error" message: Show[Esta] Show::gtype: Rotate is not a type of graphics. >> No luck also with function->Graphics Graphics[Esta] Does anyone can help with this Problem?

Thanks in advance for your help Wishing you All Joy and Happiness

POSTED BY: Juan Tamara

Thanks for the reply Sean!

As mentioned above, I did also try the "Rotate" function as such:

Rotate[a,Pi/3,{1,0,0}]

And I got the error:

Coordinate {1, 0, 0} should be a pair of numbers, or a Scaled or Offset form.

Any idea why?

Thanks!

Mathematica distinguishes between "Images" and "Graphics". See the documentation for information about them.

ImageRotate is for Images, but SphericalPlot3D produces a Graphic.

There is a specific function for Graphics rotation: https://reference.wolfram.com/language/ref/Rotate.html

Rotate[a, Pi/2, {0, 0, 1}]

Another way to do this is to use the ViewPoint option: http://reference.wolfram.com/language/ref/ViewPoint.html

POSTED BY: Sean Clarke
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