Rotation x,y,z axis simultaneously ?

Hi anybody,
I'm new to java 3d programming & having problem in doing simultaneously rotation along the x,y,z axis.
Imagine of "a plane going up, and turning to left"
someRotation.rotX(degree1);
someRotation.rotY(degree2);
someRotation.rotZ(degree3);
transform3D.mul(someRotations);
transformGroup.transform(transform3D);
Is anybody have any idea how to resolve it?
Thanks in advance

since nobody answering the question.
I find it myself on the web, and got the answer by applying matrix transfromation,
please read following website:
http://www.garybeene.com/3d/3d-math.htm
cheers,

Similar Messages

  • How to make a still picture rotate around a vertical axis ?

    H there,
    Can I know how do I make a still picture rotate around a vertical axis ?
    Thanks

    Thanks MTD,
    It is indeed one good trick ...
    From your timeline, it seems that you applied a transition after each clip. Can I know why & what transition you applied ?
    Can you please elaborate what you meant by "I changed the last keyframe in the last clip to a Smooth" ?
    Thanks again ...
    Cheers
    Meg The Dog wrote:
    Hi -
    While Mr. Wolsky is absolutely correct that you need the other software to do the effect you describe correctly, I believe you can make an approximation of what you want using FCE. Whether or not it passes the smell test is up to you.
    You can see a clip I made [HERE|http://www.spotsbeforeyoureyes.com/3DTurn_Example.mov]
    Because when you rotate the frame 360 degrees using the Y-axis, the image always comes back to the same position - which gives you a handy place to match cut to the next implementation of the rotation at a slightly slower pace. The last rotation was smoothed to a stop by modifying the filter keyframe to "Smooth".
    So (not acounting for the pad video at the head and tail of the clip, a 1 second clip, followed by a 2 second clip, followed by a 4 second clip to give me a 7 second move.
    !http://www.spotsbeforeyoureyes.com/3dTurnTimeline.jpg!
    I applied the filter to the first clip, and set it so that it went from -360 to 360 in Y axis rotation. I then copied that clip and used Command -V to apply the same effect to the next to clips via paste attributes, UNCHECKING the Scale Attribute Times so that the spinning would slow down as the clips lengthened.
    Lastly, I changed the last keyframe in the last clip to a "Smooth" , and added head and tail trim to the entire effect so the bars would start static, spin and the end static.
    Like I say, it's far from perfect but may either point you toward a solution or trigger ideas of your own.
    MTD

  • Can I rotate labels in X axis?

    Hi All
    How can I rotate labels in X axis?
    Thanks in advance
    AG

    Hi
    Yes you can rotate the X axis labels.
    Right click on X axis lables and go to format Axis Labels-->select the angle in rotation 45/90/180/270
    Hope this helps!!
    Regards
    Sourashree

  • Rotation around an arbitrary axis in Flex

    I am hoping to animate the rotation of an object around an arbitrary axis.  Is it possible to do this with the animation classes in Flex 4?  I can get it to work using the Rotate3D function, but only around the x-, y- or z-axis.  I'll explain...  I have objects that are subclasses of FilledElements, because I need them to be filled with bitmaps.  These elements are created using drawPath, because they can be any type of polygon in the xy plane.  I need to be able to "flip" an object, using any one of its sides as an axis.  The "flip" is a 3D rotation.  The flip works for a rectangle whose width is parallel to the x-axis or length is parallel to the y-axis.  But, if I have a triangle or other polygon whose sides are not parallel to any axes? How can I generate a 3D rotation on one of its sides?
    I tried setting different values using SimpleMotionPath on the transform property.  I tried using the animation class, but it needs a property, and I'm not sure what property maps to what I need.  I thought changing the transform property using SimpleMotionPath might work, but that doesn't do it.  I have tried using matrix.appendRotation on the object, but I'm not sure how to animate using that function.
    Thanks!  Any help would be appreciated.

    It is not the spheres I am worried about in this instance. I can move the spheres as I need to however, there are linking cylinders between those spheres. I easily find the midpoint for the cylinder to be located at but the cylinder needs to be aligned so it is pointing to the central sphere and the external sphere. That is what the above code is trying to generate, a matrix4d transform that rotates and aligns the cylinder along the direction required.
    Cheers
    Mark

  • Can you rotate on a 3D Axis after you used the 3D perspective?

    I used the 3D perspective get the angle i want, then i want it to rotate on that axis so it looks 3d, i will attached a picture so you can see what i mean

    I would add the rotation to the graphic, nest that clip and then add the 3d perspective to the nest.

  • Particle Emitters - Rotate Particles on X-Axis...?

    Right now, the Fall Leaves particle emitter in Motion 4 causes a series of leaves to fall facing the camera.
    I'm wanting each leaf to flip individually on their X-Axis, making them fall more like actual leaves.
    How do I do this?
    I've just adjusted the particle emitter to be 3D *as well as checked off the Face Camera option in the Emitter pane, and still have not seen a way to make this done.
    I can adjust the axis in the Fall Leaves Sequence the emitter was made from, but it flips each leaf the same way.
    Can this effect be done?
    Thank you for your help!

    Here's what I'd do as a possible solution. Duplicate the image sequence several times (4-5) and add them to your emitter. Lower the birth for all of them until combined you have about the same number as before with one.
    Then apply the randomize behavior to the X rotation of each of the duplicate image sequences. Give them low frequency and noise settings, but make each behavior slightly different. Also set the start X rotation for each duplicate to a different point.
    Now you'll have about 4-5 random changes in X rotation. This should help trick the eye into seeing more naturally occurring leaves.
    Andy

  • Animate-in rotating letters on X axis?

    I'm trying to create a very specifc animation.  The idea is to mimic how a train station's leaderboard rotates the letters of the destination's word.  I have the text written out and I've applied a spin to the text layer but it spins the entire sentence, rather than giving the ability to rotate each letter on the X axis.
    Any ideas as to how this can be  done?

    I was able to figure out how to rotate each letter using the Sequence plugin.  However, it seems to rotate the text from the bottom of the word rather than its middle axis.  I've played with all the of the rotation settings I can think of and none of them seems to effect the actual spot from where the letter rotates.
    Any thoughts?

  • Need to rotate image around the axis

    Hi, I'm using this ti rotate the image, it works but I need to rotate the image around the center of the image, center axis.
    I don't understad what is the meaning of values 50 and 60, and what I need to write instead?
    public void paintComponent_new(Graphics g){
    super.paintComponent(g);
    Graphics2D g2 = (Graphics2D)g;
    g2.rotate (Math.toRadians(angle),60,60);
    g2.drawImage(pre.getImage(), 50, 50, this);
    g2.dispose();
    }

    Using that method, the rotation occurs around the point (x,y). The rotation is a measure of theta radians. One radian translates to 180/PI degrees; thus, there are 2*PI radians in 360 degrees.
    So if, for example, you wanted to rotate round the point (40,40) exactly 90 degrees, you could use
    Graphics2D g2d = ...;
    g2d.rotate(Math.PI/2, 40, 40);Note that this rotation is a translation of the view, not a translation of any contents. That means that anything drawn to the Graphics2D object will appear as if rotated in that fashion. Therefore, if you draw an image onto that Graphics2D object after calling rotate in that fashion, the image will be rotated as well.

  • Rotating around a local axis

    Hi,
    I am trying to rotate an object around its local Y axis instead of the global Y axis.
    It is only to rotate at most 90degrees, and all the example code i have seen on the RotationInterpolator shows only how to set it off on a constant rotation, but im sure its possible to change it.
    What I have right now, that just sends the object spinning is this method
    TransformGroup rotate(Node node) , Alpha alpha){
              TransformGroup group= new TransformGroup();
              group.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
                                   RotationInterpolator interpolator = new RotationInterpolator(alpha,group);
                                   interpolator.setSchedulingBounds(new BoundingSphere(
                                               new Point3d(0.0,0.0,0.0),1.0));
                          group.addChild(interpolator);
              group.addChild(node);
              return group;I want to modify it so i can pass in an angle, and only rotate that much.
    Can anyone help?

    here is my version of SimpleObject3D that i wrote a while back, it does all these things and a bit more, no comments so you would have to work your head around the code...
    there are better ways to what i did, but this was the first code i wrote for j3d, there was an object3d i wrote which fits this class if i'll find it i will add it here too....
    have fun
    package object3D;
    import java.util.ArrayList;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    public class SimpleObject3D
         private ArrayList<TransformGroup> tgs=new ArrayList<TransformGroup>();
              tgs.add(new TransformGroup());
         boolean isPickable=true;
         public void addToBaseTG(Node node)
              addToTG(node,0);
         public void addToLastTG(Node node)
              addToTG(node,tgs.size()-1);
         private void addToTG(Node node, int index) {
              tgs.get(index).addChild(node);
         public void addToTG(Node node,TransformGroup tg)
              int index=tgs.indexOf(tg);
              if(index==-1)
                   throw new IllegalArgumentException();
              else
                   tgs.get(index).addChild(node);
         public static Transform3D getTransform3DSet(float x,float y,float z)
              Vector3f vec=new Vector3f(x,y,z);
              Transform3D trans=new Transform3D();
              trans.set(vec);
              return trans;
         public TransformGroup getTransformGroup()
              for(int i=1;i<tgs.size();i++)
                   tgs.get(i).addChild(tgs.get(i-1));
              return tgs.get(tgs.size()-1);
         public BranchGroup getBranchGroup()
              BranchGroup bg=new BranchGroup();
              bg.addChild(getTransformGroup());
              return bg;
         public void moveBy(double moveX,double moveY,double moveZ)     
              Vector3d vec=new Vector3d(moveX,moveY,moveZ);
              moveBy(vec);
         public void moveBy(Vector3d vec)     
              Transform3D trans=new Transform3D();
              trans.set(vec);
              moveBy(trans);
         public void moveBy(Transform3D trans)     
              TransformGroup tg=new TransformGroup();
              tg.setTransform(trans);
              tgs.add(tg);
         public void angleX(int angle)     
              angleX((double)angle);
         public void angleX(double angle)
              angle*=Math.PI/180;
              Transform3D axisAngleTransform3D=new Transform3D();
              axisAngleTransform3D.rotX(angle);
              tgs.add(new TransformGroup(axisAngleTransform3D));
         public void angleY(int angle)     
              angleY((double)angle);
         public void angleY(double angle)
              angle*=Math.PI/180;
              Transform3D axisAngleTransform3D=new Transform3D();
              axisAngleTransform3D.rotY(angle);
              tgs.add(new TransformGroup(axisAngleTransform3D));
         public void angleZ(int angle)     
              angleZ((double)angle);
         public void angleZ(double angle)
              angle*=Math.PI/180;
              Transform3D axisAngleTransform3D=new Transform3D();
              axisAngleTransform3D.rotZ(angle);
              tgs.add(new TransformGroup(axisAngleTransform3D));
         public void spinAroundCenter(long l)
              spin(l,getTransform3DSet(0f,0f,0f),(float)(2*Math.PI));
         public void spin(long l, Transform3D radiusToPoint,float spinAngle)
              TransformGroup toAdd=new TransformGroup();
              toAdd.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
              Alpha axisZ_Alpha=new Alpha(-1,l);
              RotationInterpolator axisZ_Rotation=new RotationInterpolator(axisZ_Alpha,toAdd
                        ,radiusToPoint,0f,spinAngle);
              BoundingSphere axisZ_Bounds=new BoundingSphere();
              axisZ_Rotation.setSchedulingBounds(axisZ_Bounds);
              toAdd.addChild(axisZ_Rotation);
              tgs.add(toAdd);
    }Edited by: TacB0sS on Apr 3, 2009 1:53 AM the old code was too old it was one of my first, very stupidly done, this should be easier to understand

  • Limiting rotation of Transform to one axis at a time.

    I have a situation where I want to force a transform returned from a picking tool to only rotate around or translate along a single axis. To do this, I'm using the transformChanged() function shown below. It works fine for the translation changes, but has problems for the rotation case. If the rotations are about one axis only it's ok, but when rotations are combined (30 degrees on X, then 60 degrees on Y) say, the object flips around in strange ways.
    I understand that my approach to the rotation limit was too simplistic, but none of the other approaches I've tried has worked either. I'm very new to Java3D programming and have run out of ideas, can anyone else suggest something to try?
    // Callback from Picking tools.
    public void transformChanged(int type, TransformGroup tg)
        if((selObj != null) && (tg != null))
            // Get the current Transform3D
            Transform3D current = new Transform3D();
            tg.getTransform(current);
            // Get the current transform vector
            Quat4f currQuat = new Quat4f();
            Vector3f currVect = new Vector3f();
            current.get(currQuat, currVect);
            double currScale = current.getScale();
            System.out.println("transformChanged - scale = "+current.getScale());
            // Set global current variables
            curPosition = currVect;
            curQuat4f = currQuat;
            // Only allow movement on the chosen axis
            if(moveX)
                if(type == PickingCallback.TRANSLATE)
                    currVect.setY(oldPosition.getY());
                    currVect.setZ(oldPosition.getZ());
                else if(type == PickingCallback.ROTATE)
                    currQuat.setY(oldQuat4f.getY());
                    currQuat.setZ(oldQuat4f.getZ());
            else if(moveY)
                if(type == PickingCallback.TRANSLATE)
                    currVect.setX(oldPosition.getX());
                    currVect.setZ(oldPosition.getZ());
                else if(type == PickingCallback.ROTATE)
                    currQuat.setX(oldQuat4f.getX());
                    currQuat.setZ(oldQuat4f.getZ());
            else if(moveZ)
                if(type == PickingCallback.TRANSLATE)
                    currVect.setX(oldPosition.getX());
                    currVect.setY(oldPosition.getY());
                else if(type == PickingCallback.ROTATE)
                    currQuat.setX(oldQuat4f.getX());
                    currQuat.setY(oldQuat4f.getY());
            // Set old global variables.
            oldPosition = currVect;
            oldQuat4f = currQuat;
            // Set the rotation and position back
            // into the transform.
            current.set(currQuat, currVect, (float)currScale);
            // Set the Transform3D back into the TransformGroup
            try
                tg.setTransform(current);
            catch(BadTransformException btex)
                System.out.println(btex);
                System.out.println("current transform = \n"+current);
    }Edited by: billphil on Mar 17, 2008 10:56 AM
    Edited by: billphil on Mar 17, 2008 11:07 AM
    Edited by: billphil on Mar 17, 2008 11:18 AM
    Edited by: billphil on Mar 17, 2008 11:21 AM

    thanks!
    i have tried using a file as a shared resource, and i
    can now check whether an instance of my application
    is already running. however, i can't make the
    currently running application window to be
    automatically displayed after the checking. Ar running application could listen on a port so you could tell it to display itself by using TPC/IP. This would require some additinals code in your app, but that shouldn't be a real problem.
    If you shared resource is already a port then you could use this port. And if it is a file you could add some additionla information to this file. Like the port number. In this case you could avoid having to use a predefined port (that could be already used by a a completely different app even though it is not very likely) by using an anonymous ServerSocket (by using "new ServerSocker(0)" and "getLocalPort()")

  • CS6: Ps 3D Rotation Z Axis Motion?

    Hey guys, how do you add keyframes to 3D Rotation Z Axis on the Ps timeline?

    Just did a test and it works.
    Scroll down your animation panel unti you see 3D Meshes. Open it to display the name of your mesh.
    Click the stopwatch icon to enable keyframing
    Drag the timeline to the length of time desired.
    Rotate your mesh along the z axis to create a new keyframe.
    (To rotate along the z axis, make sure your mesh is selected in the 3d properties panel. Move your cursor over the green arrow on the mesh in the document. Continue to move your cursor downwards towars the arrow until you see a yellow circle display. At that point a tooltip should show the words rotate on z axis. Drag the circle in either direction to rotate your mesh.)

  • 3D within CS5 Extended... force transform (rotate, move, scale, etc.) on a particular axis...?

    Hello,
    Thanks for any help regarding my question.
    I'm new to 3D as this question will be obvious to 3Ders.
    I'm importing art from either Sketchup or Swift3D. When it is imported I use the varying transform methods:  scale, rotate and move. I utilize the 3D axis UI where it allows me to drag the manipulators on the 3D axis UI.
    Sometimes I'm unable to grab a certain attribute (usually it's rotate because the axis in question (i.e. X) is not visibly available or is behind another axis. So I usually have to move unprecisely to see that axis so I may grab and drag.
    Is there a way to force a transform property on a particular axis? So if I want to rotate on the X axis can I hold down a keyboard shortcut and drag? So it doesn't accidentally move another property I'd like not to transform, or allowing me to perform the transformation without having to move the axis UI so a axis modifier is more visible (thus allowing me to drag)?
    I hope all of that made sense.
    Thanks!!!

    As everything in PS - Ctrl, Alt and shift are your friends.
    Mylenium

  • Rotation about ANY axis

    Hi all !!!
    I am a novice to 3d programming but i have done some JAVA programming earlier.
    The problem i am finding is that I do not know how to rotate any geometric object (say, a cylinder or a cone) about any arbitrary axis, say ax+by+c=0.
    Can anybodyhelp me ???
    Thanks in advance.
    Ajay

    I am pretty sure I know what you are talking about.
    //Create the Object
    //Create a transform group for your object
    TransformGroup tg = new TransformGroup();
    // Now you need to make a Transform3D to do the rotational work
    Transform3D tr = new Transform3D();
    //To rotate around any axis use setRotation and pass
    // is a Quat4D (or f,i)
    // Quat takes 4 arguments x,y,z,w use the x,y and z to
    // create a vector to rotate around. i.e. (0,1,0,.4) would
    // rotate arount the Y axis, (1,1,0, .4) would rotate
    // around a line between x,y.
    // The W in the Quat is the angle to rotate (in Radian 0-2Pi);
    //So ...
    tr.setRotation( new Quat4d(1,1,0,.4));
    tg.setTransform(tr);
    //Add your object to your transform group
    tg.addChild(your_object);
    //Add your TRansformGroup to the world
    root.addChild(tg); //or whatever your BranchGroup is called
    I hope that is what you wanted. And does what you need.

  • ROTATING A CUBE IN 3D SPACE

    Hello,
    I've created my first 3D cube in AE and I am trying to manipulate it in 3d space.
    I've created a null object and made it the parent of all six faces.
    Everything works fine, except for one thing.
    When I change the value of the X-setting on my null object, the cube rotates vertically rather than horizontally.  That seems to be the opposite of what I would expect.
    Any thoughts on that?
    Here are two screen shots that illustrate my dilemma.
    Thanks!  
    Matt

    Huh?  Things look just fine.  The x-axis is the one that runs from right to left in that comp. 
    Hold a pen in front of you by your fingers, using both hands.  Using the tumb and forefinger of each hand, make the pen turn.  That's rotation on the x-axis... which is what your cube is doing.

  • Worthless 3d rotation tool :/

    Okay sorry bout the vague thread title but this is pissing me off.  I imported a bitmap, converted it to a vector object and created a motion tween.  In the first frame I used 3d rotation on the x-axis to tilt the image away from me, so it looks like this:
    Now what I am trying to do in the motion tween is spin this "flattened" image all the way around 360 degrees like a turntable.  So I divide my timeline into four sections; my animation is 120 frames long so I start by putting a keyframe at 30.
    In frame 30 I change the x-axis back to normal so it looks like the original 2d bitmap again, rotate it 90 degrees with free transform (or using the z-axis in 3d rotation, either works), then use the x-axis to flatten the perspective again.  The tween works great so far; between frames 0-30 it spins 90 degrees like a turntable when I scrub the playhead.  I do the same thing again for frame 60, and again it works the way I intend, now having been spun half way around.
    The trouble is once I try to spin it any further than half way, even if I orient it correctly, from that point on Flash decides to make the tween move in a completely different direction than before, taking the long way around and flipping the entire thing upside down and over and back in some ackward path that completely deviates from the motion I had going during the first half.  I have tried and tried and tried to make it do what I am trying to get it to do but Flash keeps on second guessing me and tweening it a different direction; even if I rotate it just a tiny bit further Flash will flip it all the way over to get there, instead of taking the more obvious path and spinning it just a little more.  This is pissing me off because it just will not do what I am telling it to.  And if I try to enter rotation values into the transform panel, Flash always changes those values to some arbitrary numbers as soon as I hit enter or click somewhere else, if I change the Z it will change the X to some weird number, so I go to change the X back and then it changes the Z, so that panel is pretty much worthless for entering rotation values I've found.
    If any method exists at all to make this do what I am trying to do, I would like to know what it is.  Any help is appreciated, thanks.

    Timeline-based tweening can sometimes be difficult to tame.  Have you tried using actionscript instead of using a timeline tween?  I haven't dealt with 3d aspects of Flash, but you should be able to gradually incremement the rotationX property of the object.  If you gave the object the instance name "mc", then the folllowing should work...
    addEventListener(Event.ENTER_FRAME, spinMC);
    function spinMC(evt:Event){
        mc.rotationX += 1; // increase number for faster spin

Maybe you are looking for

  • QuickTime Player - no sound

    There's no sound on some .avi files I've recently downloaded. Not some, only a couple. I get a message that comes on saying I'm missing certain components/plug-ins (or whatever) that I need to download from a certain site in order for that particular

  • Acrobat 9.5.5 unable to find resource files

    I am using Windows Vista und with the upgrade to Adobe Acrobat 9.5.5, I lost the administrative privileges on my own computer and Acrobat is unable to find resource files. I reinstalled Acrobat 9.5.5, went through the repair option, but have been uns

  • Issue in printing table to PDF format

    Hi all, I am really facing an issue in designing reports. I have to customize the report that i am displaying in the dashboard while printing or sending it as mail.I need to create a multipage report. I have a table displayed on the dashboard. Now wi

  • Preview Quit Unexpectedly, will not open anything...

    I was trying to clean off some 3rd party font files to speed up the start-up boot process.  I erased the 2 font files that I had downloaded and now Preview will not open anything.  I have look at other "Preview Quit Unexpectedly" questions and have g

  • ADF Faces Tree - getChildren() called multiple times

    Hi, I have a simple tree based on the demo's 'tree.jspx'. Each time I click on a node in this tree, I see that TreeNodeImpl.getChildren() gets called multiple times for each node. This is not an issue in tree.jspx where the tree is static. However in