4

I'm an artist trying out digital media. I'm very new to Mathematica, however, so excuse me if this a basic question (which I'm sure it is). I did look, though, for anything on this site related to my situation.

I've created a Graphics3D object composed of many shapes, something like

mypoly = Show[Scale[Cone[], {1, 2, 2}], Cylinder[], Rotate[Cylinder...

Everything is working properly, and it looks fine, but I'd like to move it around (rotate it and actually move it in the coordinate space). Apart from individually changing the rotation and center of each component (e.g., Sphere[{1, 0, 0}]), is there something I can do to manipulate one iteration of the whole figure?

Ultimately, I'm going to be creating a bunch of different copies of the object and combining them.

UPDATE:

My attempt at translating the whole figure inspired by this question:

unit = Show[Graphics3D[Cylinder[]], Graphics3D[Scale[Cone[]...
newUnit = Graphics3D[Translate[unit, {1, 0, 0}]]

This only gives me the error "Graphics is not a Graphics3D primitive or directive."

Rotation, however, seems to work fine, though I run into trouble with Show[]:

newUnit = Rotate[unit, 180 Degree]
Show[unit, newUnit] //Could not combine the graphics objects in Show[]
Mandelbrot
  • 43
  • 5
  • Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! – Michael E2 Dec 17 '15 at 00:24
  • Look at the various geometric transformation functions available in the documentation. Examples are TranslationTransform, RotationTransform, ScalingTransform and ReflectionTransform. A real nice feature is you can apply multiple transforms to a graphics object. – Jack LaVigne Dec 18 '15 at 00:29

1 Answers1

7

You can do many things with the whole figure, f.e. rotate it

gr = Graphics3D[{Red, Opacity@0.5, Scale[Cone[], {1, 2, 2}], Blue, Cylinder[]}]

enter image description here

Animate[
 Graphics3D[Rotate[First@gr, pi, {{1, 0, 0}, {0, 1, 0}}], Options@gr, Boxed -> False],
 {pi, 0, 2 Pi}]

Update

You have to use First. With the above definition of gr

Graphics3D[Translate[First@gr, {10, 0, 0}], Axes -> True];

enter image description here

eldo
  • 67,911
  • 5
  • 60
  • 168