Re: 3D Rotations

*To*: mathgroup at smc.vnet.net*Subject*: [mg125876] Re: 3D Rotations*From*: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>*Date*: Thu, 5 Apr 2012 05:56:11 -0400 (EDT)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com

I am trying to rotate a function around a variable axis to show my students how the solid looks and am having problems with the axis of rotation. Basic example: RevolutionPlot3D[x^3, {x, 0, 2}, AxesLabel -> {x, z, y}] However I want the function to rotate around an axis other than x == 0, say, x == -1. I have tried the RevolutionAxis command but it isn't working. Any help would be appreciated. You may use Rotation. Try this, for instance: Rotate[RevolutionPlot3D[x^3, {x, 0, 2}, AxesLabel -> (Style[#, 16, Italic] & /@ {x, z, y})], \[Pi]/10, {-1, 0, 0}] You may wrap it with Manipulate. Try this: Manipulate[ Rotate[RevolutionPlot3D[x^3, {x, 0, 2}, AxesLabel -> (Style[#, 16, Italic] & /@ {x, z, y})], a, {-1, 0, 0}], {a, 0, 2 \[Pi]}] Finally, you may make a list of graphics and either animate it using the ListAnimate (it is convenient to execute them in separate cells), or export it as a stand-alone avi file. Try this: lst = Table[ Rotate[RevolutionPlot3D[x^3 - 4, {x, 0, 2}, AxesLabel -> (Style[#, 16, Italic] & /@ {x, z, y}), PerformanceGoal -> "Quality"], a, {-1, 0, 0}], {a, 0, 2 \[Pi], 0.05}]; ListAnimate[lst, AnimationRate -> 5, AnimationRunning -> False, AnimationRepetitions -> 1] or this: Export["Full_trajectory_to_the_file\movi.avi", lst, "FrameRate" -> 5] After that you will have the file entitled "movi.avi" in the place specified by the ["Full_trajectory_to_the_file". There is one problem here, that you would like to rotate not around a symmetry axis, and with respect to some point at the extremity of your image. I moved the origin by 4 downwards, but this seems not to help enough. You might play with this parameter. As an outcome the image jagging shows up. You may try to coped with it specifying the PlotRange. Have fun, Alexei Alexei BOULBITCH, Dr., habil. IEE S.A. ZAE Weiergewan, 11, rue Edmond Reuter, L-5326 Contern, LUXEMBOURG Office phone : +352-2454-2566 Office fax: +352-2454-3566 mobile phone: +49 151 52 40 66 44 e-mail: alexei.boulbitch at iee.lu