Rotation around global coordinates?

hey, i wanna to make an animation of camera. the situation looks in this way:
i have a box in center of global coordinates and i want to make a rotation of camera around y axis (y of global coord.). when i use setOrientation(...) it makes a rotation around local coordinates of camera. how change it if i want to rotate it with global coordinates? im completly new in 3dmobile, i tried to found any solutions with api documenation but i couldnt :(. i have to make it quickly so i dont have time to read all spec.
please help me!
thanks in advance

ok nevermind :]

Similar Messages

  • Rotating object around global axises.

    Hi there. I'm writing a simple Java3D application, intended for viewing a object loaded from OBJ file, allowing user to scale and rotating this object, by using keyboard, around all axises.
    My problem is, that every rotation is occurring around local axises, apparently relative to object, and my intention is, to rotate object relatively to world's coordinations or just camera's.
    My Behaviour class code goes here:
    (some variables names are in my native language)
    public static class ObjectManipulation extends Behavior{
        private TransformGroup targetTG;
        private Transform3D trans = new Transform3D();
        private Transform3D temp_trans = new Transform3D();
        private double skala = 0.4f;
        ObjectManipulation(TransformGroup targetTG) {
            this.targetTG = targetTG;
        public void initialize() {
            this.wakeupOn(new WakeupOnAWTEvent(KeyEvent.KEY_PRESSED));
        public void processStimulus(Enumeration criteria) {
        WakeupCriterion wakeup;
        AWTEvent[] event;
            while( criteria.hasMoreElements() ) {
              wakeup = (WakeupCriterion) criteria.nextElement();
              if(wakeup instanceof WakeupOnAWTEvent) {
                    event = ((WakeupOnAWTEvent)wakeup).getAWTEvent();
                        for( int i = 0; i < event.length; i++ ) {
                            if( event.getID() == KeyEvent.KEY_PRESSED )
    checkEvent((KeyEvent)event[i]);
    this.wakeupOn(new WakeupOnAWTEvent(KeyEvent.KEY_PRESSED));
    private void checkEvent(KeyEvent ke) {
    int klawisz = ke.getKeyCode();
    if(klawisz == KeyEvent.VK_S) {
    temp_trans.rotY(Math.PI/10.0f);
    trans.mul(temp_trans);
    targetTG.setTransform(trans);
    } else if (klawisz == KeyEvent.VK_A) {
    temp_trans.rotY(Math.PI/-10.0f);
    trans.mul(temp_trans);
    targetTG.setTransform(trans);
    } else if (klawisz == KeyEvent.VK_W) {
    temp_trans.rotX(Math.PI/10.0f);
    trans.mul(temp_trans);
    targetTG.setTransform(trans);
    } else if (klawisz == KeyEvent.VK_Z) {
    temp_trans.rotX(Math.PI/-10.0f);
    trans.mul(temp_trans);
    targetTG.setTransform(trans);
    } else if (klawisz == KeyEvent.VK_X) {
    temp_trans.rotZ(Math.PI/10.0f);
    trans.mul(temp_trans);
    targetTG.setTransform(trans);
    } else if (klawisz == KeyEvent.VK_C) {
    temp_trans.rotZ(Math.PI/-10.0f);
    trans.mul(temp_trans);
    targetTG.setTransform(trans);
    } else if (klawisz == KeyEvent.VK_M) {
    if(skala > 0.1f) {
    skala -= 0.1f;
    } else {
    skala = 0.0f;
    trans.setScale(skala);
    targetTG.setTransform(trans);
    } else if (klawisz == KeyEvent.VK_N) {
    if(skala <= 3.0f) {
    skala += 0.1f;
    } else {
    skala = 3.0f;
    trans.setScale(skala);
    targetTG.setTransform(trans);

    OK, using the tornado example. i want the point where the 'tornado' meets the 'ground' to spin so that the 'tornado', well, looks like a tornado, spinning around a specific, i.e. x,y,z pixel. instead i have a tornado that seems to be pulling doughnuts in the farm carving out a huge cirlce (like the aliens do) rather than what a stationery tornado would carve out (if there was such a thing).
    if it helps, think about the bounding box that surrounds an object or layer. the entire bounding box spins around the anchor point, or at least that's what it seems it is doing. it draws a huge circle that it ROTATES around rather then one point that is SPINS around. think about rotating a camera around it's Y axis, the whole box rotates, moving everything rather than spinning without moving. thanks.
    hope this helps.

  • Animate a cube to rotate around x axis!!!

    Hi! I'm trying to animate a cube to rotate around x axis using RotationInterpolator object.
    Can anyone kindly tell me how I can do that? I've seen the example at Sun's 3d tutorial but they use the default behavior which is rotating around y axis.
    Thanks in advance.
    --DM

    lol
    in fact the axis used in the RotationInterpolator is the one which is on the y axis in the local coordinates system obtained after the Transform3D is performed
    for example:
    - if you use only new Transform3D(), which does nothing, the axis will be y
    - but if you use rotz(), this transform3D transforms the old x axis into the new y one, the old y axis into the new -x one and the old z axis into the new z one. Thus in the new local coordinates system obtained, the new y axis matches the old x axis, so this x axis is used for the interpolator
    I don't know if I'm very clear, it's difficult to explain and I'm French ;)
    see the java 3D API :
    http://java.sun.com/products/java-media/3D/forDevelopers/J3D_1_3_API/j3dapi/javax/media/j3d/RotationInterpolator.html#RotationInterpolator(javax.media.j3d.Alpha, javax.media.j3d.TransformGroup, javax.media.j3d.Transform3D, float, float)

  • Local to global coordinates...

    Hi all... How do I translate local coordinates from within an object to global coordinates in respect to the frame of the application....
    Im trying to implement mouse dragging on a number of objects within a JFrame. Im applying the listeners to the individual objects, but want to move it in respect to the frame....
    Is there a way to get the coordinates of the mouse in respect of the frame, even though the listener is attached to the object...
    Thanks in advance... Oh, and sorry if this post is badly written, my gf is distracting me lol...

    getX and getY will give you the position relative to the parent component. There may be some methods for position relative to the containing Window - take a look around SwingUtilities and Toolkit.

  • How can I get an object to rotate around another object in Motion 5? Also, can I export on a transparent background to FCPX?

    Attempting to make one .png (its and arrow) rotate around a circlular logo which is also a .png. I need to them come out of Motion 5 for FCPX on a transpartent background. Anyone have any help for me. Stuck on this for hours now.

    Thanks Russ...
    I spend severale hours (new to Motion) trying to figure out how to set the orbit around the cicular logo. I was able to finally get it. I was missing the square under the orbit behavior that I could plug in the circular logo. lol... Once I got that set, I added to the align to motion behavior and set the drag to that behavior to get it all to rotate and work right. I then published as a generator to FCPX. After setting the background to transparent.
    Works like a charm. Just took most of my day trying to figure it out. lol.. But thats how you learn I guess.
    Thanks for the reply!

  • 3D rotate around a circle preset ae6

    Hello thanks for looking in..
    I am messing with the (3D rotate around a circle) preset in AE6 and if you notice that the Browse Preset feature shows the 3D text completing a circle.. Yet, When I create a text layer, apply the preset effect there is a gap from the end of my last word typed to the start of the word typed.
    IE: TV Bug TV Bug TV Bug TV Bug  (space) beginning of TV Bug instead of looking as the preset does in Browse Presets. TV Bug in a complete circle and spaced evenly.
    I hope this is making sense...I want the "g" in Bug to be spaced as a contiunued circle, so that Last "g" in Bug should butt up to the first "T" in TV. As it stands now I type it out and apply the preset and there is a huge space between the last "g" in Bug and the first "T" in TV.
    What do I need to mess with too get the ends to meet?
    I added a couple of pics to help describe:
    First one is the preset
    2nd one is my challnege of the ends not meeting
    Thanks again
    NC

    RG thanks again for hopping in here. You are a great help and I am thankful to have you perusing these forums.  I did get it to work. Although I do have a question or two about adding one keyframe to create a seemless loop.
    1. I add one frame via End > Page Down. However, I am unclear on where to park the last keyframe to make it a seemless loop? I ended up adjusting the First Margin on that effect to get it to start at the point I desire and then hit END to place the last KeyFrame. I of course made my last keyframe spot on where it starts as to not have a "Jump" in text when it restarts.....
    2. The other thing is the effect on that goes from one speed and slows to a stop and then of course starts again when going back to the beginning. I used Ease In and Ease out however I do not have control over the speed. IE: One speed throughout... Any suggestions on that one RG?
    Regards
    NC

  • Having trouble with multiple rotations around an objects poles

    Hey all, i am new to java 3d (only started coding today) but i have been coding in Java for a while..
    I am having a problem understanding how to perform the rotations i want to. I have read the majority of the literature i can find on performing these kinds of rotations. I realise that i need to have correctly linked nodes in the graph so that i am rotating around the correct points and i think i have accomplished this. However, i cannot get the system to rotate around the objects poles. To clarify, i can get the object to rotate around one of its poles (x , y, z) in some cases but trying to do multiple rotations causes problems.
    import javax.media.j3d.Appearance;
    import javax.media.j3d.BranchGroup;
    import javax.media.j3d.ColoringAttributes;
    import javax.media.j3d.PolygonAttributes;
    import javax.media.j3d.Transform3D;
    import javax.media.j3d.TransformGroup;
    import javax.vecmath.Color3f;
    import javax.vecmath.Vector3f;
    import com.sun.j3d.utils.geometry.ColorCube;
    import com.sun.j3d.utils.geometry.Cylinder;
    import com.sun.j3d.utils.universe.SimpleUniverse;
    public class TestRotation
         private TransformGroup objectTranslateGroup, objectRotationGroup;
         private Transform3D translate = new Transform3D(); private Transform3D  rotX = new Transform3D();
    private Transform3D rotY = new Transform3D()
    private Transform3D rotZ = new Transform3D();
         private double rotationX, rotationY, rotationZ, newRot = 10;
         private SimpleUniverse u;
         public TestRotation()
              // Create the root of the branch graph
              BranchGroup objRoot = new BranchGroup();
              rotationX = 0; //init rotations
              rotationY = 0;
              rotationZ = 0;
              ColorCube cube = new ColorCube(0.25f);
              Appearance x = new Appearance();
              Appearance y = new Appearance();
              Appearance z = new Appearance();
              x.setColoringAttributes(new ColoringAttributes(new Color3f(1,0,0),ColoringAttributes.SHADE_GOURAUD));
              y.setColoringAttributes(new ColoringAttributes(new Color3f(0,1,0),ColoringAttributes.SHADE_GOURAUD));
              z.setColoringAttributes(new ColoringAttributes(new Color3f(0,0,1),ColoringAttributes.SHADE_GOURAUD));
              Cylinder poleX = new Cylinder(0.02f, .75f, x); //RED
              Cylinder poleY = new Cylinder(0.02f, .75f, y); //BLUE
              Cylinder poleZ = new Cylinder(0.02f, .75f, z); //GREEN
              Transform3D poleXTransform = new Transform3D();
              Transform3D poleYTransform = new Transform3D();
              Transform3D poleZTransform = new Transform3D();
              poleXTransform.rotZ(Math.toRadians(90));
              poleZTransform.rotX(Math.toRadians(90));
              TransformGroup poleXTransformGroup = new TransformGroup(poleXTransform);
              TransformGroup poleYTransformGroup = new TransformGroup(poleYTransform);
              TransformGroup poleZTransformGroup = new TransformGroup(poleZTransform);
              poleXTransformGroup.addChild(poleX);
              poleYTransformGroup.addChild(poleY);
              poleZTransformGroup.addChild(poleZ);
              translate = new Transform3D();
              translate.setTranslation(new Vector3f(0,0,0)); //init position
              rotX.rotX(Math.toRadians(rotationX));
              rotY.rotY(Math.toRadians(rotationY));
              rotZ.rotZ(Math.toRadians(rotationZ));
              objectTranslateGroup = new TransformGroup();
              objectTranslateGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
              objectRotationGroup = new TransformGroup();
              objectRotationGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
              objectRotationGroup.addChild(cube); //add the object to the rotation group
              objectRotationGroup.addChild(poleXTransformGroup); //add the object to the rotation group
              objectRotationGroup.addChild(poleYTransformGroup); //add the object to the rotation group
              objectRotationGroup.addChild(poleZTransformGroup); //add the object to the rotation group
              objectTranslateGroup.addChild(objectRotationGroup); //add the rot group to translate group
              objRoot.addChild(objectTranslateGroup); //add to root
              u = new SimpleUniverse();
              u.getViewingPlatform().setNominalViewingTransform();
              u.addBranchGraph(objRoot);
              this.begin();
         private void begin()
              while(true)
                   //rotationX += newRot; //rotate slightly
                   rotationY += newRot;
                   rotationX += 0; //rotate slightly
                   //rotationY += 0;
                   rotX.rotX(Math.toRadians(rotationX));
                   rotY.rotY(Math.toRadians(rotationY));
                   rotZ.rotZ(Math.toRadians(rotationZ));
                   rotY.mul(rotX); //multiply rotations
                   rotZ.mul(rotY);
                   objectRotationGroup.setTransform(rotZ); //update
                   try {
                        Thread.sleep(300);
                   } catch (InterruptedException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              new TestRotation();
    }As you can see the code is a full class so you can copy and paste it to run it... In the 'begin' method you will notice the variables that update the rotation, currently when the cube rotates on the y axis the cube is rotating around the viewers Y axis and not around the objects y pole. However, if you change the values so the cube is set to rotate around the X axis then it will treat the x axis as the objects x pole and not the viewers x axis. I presume this is because of the multiplication of the matrices.
    What i want to know is how can i set it so that if i say rotate around the y axis it rotates the cube around its y axis (as in the y pole) regardless of where the y pole is. Not only that but i need to be able to rotate around multiple axis ensuring that it is rotating around the objects poles correctly.
    The reason for this is that the object will be turned into an auv (underwater vehicle) fitted with thrusters which are going to turn the vehicle so no matter how the vehicle is positioned (facing up, upside down etc) the thruster always rotate around the same axis on the block.
    Hope this makes sense, sorry for the long post!!
    edd
    Message was edited by:
    edwardr

    Since the 2-Wire gateway is providing both modem and DHCP services, you would want to insure that the Time Capsule is not also configured to provide DHCP services as well.  If this were the case, that would mean two routers are trying to do the same thing on the same network. You only want one device on a network performing as a router.
    The reason for this is that a two router setup is likey to create IP address conflicts on the network, which likely may be your issue.
    To check, open Macintosh HD > Applications > Utiltiies > AirPort Utility
    Click on the Time Capsule icon, then click Edit
    Click the Network tab at the top of the next window
    Insure that the setting for Router Mode is set to Off (Bridge Mode)
    Click Update to save the correct setting
    Then power cycle the entire network by powering off all devices in any order that you want
    Wait a minute
    Start the 2-Wire gateway first and let it run a minute by itself
    Start the Time Capsule next the same way
    Continue starting devices the same way until everything is powered back up.
    Power off the entire network...all devices...and wait a minute

  • 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

  • Final cut color balance key framing - Marker rotating around the center, giving a pink hue

    Hi
    I'm currently editing a music video that uses a single shot, but it progresses through many different scenes and lighting conditions. What I'm doing is keyframing the different color corrections so they smoothly transition as the camera pans across different sets.
    The problem I'm having is that during the transition from one correction to the next, the marker rises up into the pink area. This gives the transition and awkward and unwanted pink/red hue at the peak of the transition before it settles down into what I wanted.
    An example is one scene I keyframe a warm yellow and as it transitions into the scene I keyframe a cool blue. But during the transition, the marker rotates around the middle of the corrected and always goes up into the pink area instead of just simply going from Point A to point B
    I'm sure it's just a setting I've clicked as it was working fine before
    I'm using the color corrector 3-way
    Final cut pro 7
    Mac OSX Lion 10.7.4

    You might try adding edits using the blade tool and dissolving between the color corrections rather than keyframing.   When you keyframe, it's got to get from one color setting to another so the parameters will have to change over time which is what I imagine is happening to you.   Not sure how my scheme would work, but worth a try.

  • How do you rotate around a local point?

    Hi,
    I'm having problems using RotationInterpolators.
    I'm trying to build a 3d figure and animate it. I can use pickRotate behaviours to rotate the different limbs around their local centres, but I'm now trying to do it via the RotationInterpolator and every time they get moved to the central point of the whole scene, and rotated around this, rather than that of their own TransformGroup.
    I have a BranchGroup (objRoot), and a TransformGroup for the entire figure (figTrnsGrp), which is the child of objRoot, and is centred. The children of figTrnsGp are a cylinder (the figure's upper chest), and four TransformGroups - one each for the neck, pelvis, left shoulder, and right shoulder. These in turn have their own TransformGroup children which deal with the other parts of the body. I added the RotationInterpolator as a child of the TransformGroup I want it to rotate.
    So, for example, I want the pelvis to rotate around its own centre (taking the legs with it, which it does, but it gets moved up and rotated around the centre of the figure!). Actually, i can't work out if it's being rotated round the figure centre, or the scene centre, but anyway it's not doing what i want it to and I've been trying different things for days, and none of them work, so if anyone can PLEASE help, i'd really appreciate it!
    I think the problem may be that the Transform3D which is passed to the RotationInterpolator is somehow being reset in the process, but I still can't work it out.
    Here is some of the code:
    pelvisT3D = new Transform3D();
    pelvisT3D.setTranslation(new Vector3f(0.0f, -0.4f, 0.0f));
    pelvisTrnsGrp = new TransformGroup(transformPelvis);
    pelvisTrnsGrp.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    pelvisTrnsGrp.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
    figTrnsGrp.addChild(pelvisTrnsGrp);
    Sphere pelvis = new Sphere(pelvissize);
    pelvisTrnsGrp.addChild(pelvis);
    Alpha alpha = new Alpha(-1, Alpha.INCREASING_ENABLE, 0, 0, 7000, 0, 0, 0, 0, 0);
    pelvisTrnsGrp.getTransform(pelvisT3D);
    RotationInterpolator r = new RotationInterpolator(alpha,
    pelvisTrnsGrp, pelvisT3D, 0.0f, 3.0f);
    r.setSchedulingBounds(behaveBounds);
    pelvisTrnsGrp.addChild(r);
    many thanks to anyone who can help...

    Hi
    The problem is indeed that the RotationInterpolater will reset the transform to the identity before adding the rotation. The solution is to have your pre-animation transforms in one TransformGroup, and have another TransformGroup below that the interpolater acts on.
    BranchGroup-TransformGroup-TransformGroup-Shape3D
    ^ ^
    Your translations Attach the
    go here Interpolator here
    B.D.

  • Rotation around a different point

    I have a geometry that I am scaling and translating to appear in the center of my screen. It is still rotating around the original 0,0 axis. How can I change where the rotation center point is

    Rotations in 3D graphics is a bit weird. Help me explain...
    Take a blank piece of paper, and draw a little dot on it, roughly in the middle.
    Put the page down in front of you on a flat surface.
    The dot represents 0, 0, 0
    Take a small object (I took a memory stick) and place it anywhere on the piece of paper. This represents your 3D object.
    Now, in real life, if you want to have your object spin around in place, you'd simply turn it with your finger. On the other hand, to have your 3D model spin like that, things work a bit differently.
    Close your eyes.
    Remember where on the paper your object is, and its orientation. Pick it up and place it down on the dot (at 0, 0, 0), but keep it facing in exactly the same way it was when you picked it up. This is step 1 of your rotation sequence.
    Next, turn it a little bit in any direction. This is step 2 of the sequence.
    Now, place it back where it was on the page, but now facing in the "new" direction. Step 3.
    Finally, open your eyes. Step 4. You have now rendered the rotated object and it appears to have spinned in place.
    Repeat steps 1 - 4 and you'll have an animated 3D object.
    Now, to have that object orbit an arbitrary point in space, the same sequence as above must be followed, except for one modification to the first step. In stead of the center of rotation coinciding with the center of the object, it now lies some distance off in some direction.
    That new center of rotation is the point which must be moved (translated) to the dot (origin). When you perform your rotation, the object will "swing" around the new point (which now lies at 0, 0, 0). When you translate the point back to where it came from, and then display that frame, it will appear as if the 3D object's rotation had taken place around your intended center of rotation, or as you call it, your "different point".
    I hope you now understand the most basic concept of 3D rotation, and that you will be able to translate these thoughts into working code :)

  • 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

  • How do I get around global script protection in my CMS?

    We have global script protection enabled on our CF server.  I am the admin with full rights.  The tags it scans for and replaces with "invalidTag" are these, which are located in the neo-security.xml file:
         object|iframe|embed|xss|script|javascript|applet|meta
    However, we ocassionally introduce these tags into pages controlled by our CMS, which of course go into a database.  When that happens the tags are replaced with "invalidTag".
    I want and need script protection enabled to prevent against hackers, but I also want to be able to add these tags to our local CMS.  What is the best way around this?  Right now, I actually had to remove "object" and "embed" from the list it scans against, but I feel like this defeats the purpose.
    When I Googled this issue I saw a couple of hacks that had something to do with re-writing the tag after it was sent into the database, but that seems kind of polish to me.  I'm wondering if I'm missing some simple trick to get around this.  But then I guess if I could, a hacker could.
    Thanks for any advice.

    Thanks for clearing that up. I think you said it succinctly yourself: 'I actually had to remove "object" and "embed" from the list it scans against, but I feel like this defeats the purpose'. I think it's a matter of weighing the risks and the benefits, and then making a choice.

  • 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

  • How to limit rotation around an axis

    Hello!
    I am using Mouse Rotate to rotate an object around it's axis:
    MouseRotate mouseRotate = new MouseRotate();
    mouseRotate.setTransformGroup( sectionTransform );
    mouseRotate.setSchedulingBounds( new BoundingSphere() );
    mouseRotate.setFactor( 0, 0.3 );
    Currently it rotates 360 degrees, but I would like to be able to limit the rotation angle to say 180. Could you please help me out?
    Thanks!
    Anna.

    You might want to consider creating your own behaviour. It depends on your implementation, but if you have a Transform group above the object, you can get the transform and get the rotation values from that transform. It will take a bit of math, but here's a primer to get you started...
    http://www.martinb.com/maths/geometry/rotations/conversions/index.htm
    http://www.martinb.com/maths/geometry/rotations/conversions/matrixToEuler/index.htm
    so if you calculate the angle around a particular axis from that transform and it is "greater" than the limit, then you can just set the transform's rotation angle to the limit by reconstructing a new transform and placing that transform in the transform group.
    Anyway, I dont know if that helps. It really depends on what you have as far as implementation thus far. My best suggestion is to try to create your own rotation behaviour.
    Cheers,
    Greg

Maybe you are looking for