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 :)

Similar Messages

  • 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.

  • How to always rotate objects around the same point, even using the right-click menu?

    I need some of my objects to always rotate around the same point. How can I select a point which will stay that way?
    Using the rotate tool resets after deselecting.
    Also, I'd like to rotate objects around a certain point even when using the right click > Transform > Rotate.
    Is it possible?

    Right, so this is where Illustrator falls short with respect you your need, but only in the sense that the reference point can't be made to stick. You can, however, use Smart Guides to make it so the point is easy to set at exactly the same location, (especially since your object has an anchor point there), manually before each rotation.

  • 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

  • Snap rotate an Object by 60 degrees around a selected point?

    Hello,
    I am looking for a simple and precise way to rotate and copy an object at precisely 60 degree increments around a preselected point that is NOT the middle of the object.
    To restate: I want to be able to have all my objects at precise angles and be rotating around a selected pre-chosen point.
    I have tried many different ways with no luck.
    Can anyone help a noob?
    Dave-o

    I just checked the Download-able Help PDF (the Illustrator CS4 Online manual) and it is indeed documented under "Rotate an object by a specific angle" Unfortunately, it does not jump out off the screen.
    I understand why they don't ship manuals to reduce cost and keep a greener footprint, but I really miss them especially when you pay $500+ for a software suite. Next time I will RTFOLM! :-)
    Thanks again Scott
    Dave-o

  • How can I rotate a shape around a centre point in Illustrator?

    Hi all,
    I'm trying to make a pattern in Illustrator and I need to repeat a shape around a centre point, a bit like placing petals around the stigma of a flower. I can do it in Photoshop by moving the centre point of the bounding box to where I want to rotate the shape around, how can I do it in Illustrator?
    I also want to define this as a shape/pattern and use in Photoshop, how do I go about this?
    Many thanks,
    Foxy

    The centroid of a straight-sided polygon is located at the average of its corner points locations. For a given path (a star, for example) you can:
    1. Select the path.
    2. Copy. PasteInFront.
    3. Object>Path>Average>Both.
    For objects with curved segments, you can approximate the centroid by:
    1. Select the path.
    2. Copy. PasteInFront.
    3. Apply some command that adds a bunch of points along the curves (Object>Path>Add Anchor Points, or ZigZag with zero for Size).
    4. Object>Path>Average>Both.
    If you have alot of paths you need to do that for all at once (as when designing a hanging mobile), I have a simple Javascript for that.
    JET

  • 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.

  • Rotate about a specific point

    I have a script that creates geologic map symbols, positions them, and rotates them into their proper orientation.  However, I do not know how to rotate about a specific point (not the center of the group). The portion of script in question is:
    if (dlg.symbol.bedding.value) {
    var myLine = stGroup.pathItems.add();
    myLine.stroked = true;
    myLine.setEntirePath([[posx,posy],[posx+3,posy]]);
    myLine.strokeWidth = .75;
    var myLine = stGroup.pathItems.add();
    myLine.setEntirePath([[posx,posy - 6.75],[posx,posy + 6.75]]);
    myLine.stroked = true;
    myLine.strokeWidth = .75;
    stGroup.rotate(-azi);
    and I wish to rotate around the point [posx, posy].  How do I accomplish this?

    Thanks!  That worked.  For future reference, here's the modified section of script:
    if (dlg.symbol.bedding.value) {
    var myLine = stGroup.pathItems.add();
    myLine.stroked = true;
    myLine.setEntirePath([[posx,posy],[posx+3,posy]]);
    myLine.strokeWidth = .75;
    var myLine = stGroup.pathItems.add();
    myLine.setEntirePath([[posx,posy - 6.75],[posx,posy + 6.75]]);
    myLine.stroked = true;
    myLine.strokeWidth = .75;
    mapDoc.theOrigin = mapDoc.rulerOrigin;
    mapDoc.rulerOrigin = [posx,posy];
    stGroup.rotate(-azi, undefined,undefined,undefined,undefined,Transformation.DOCUMENTORIGIN);
    mapDoc.rulerOrigin = mapDoc.theOrigin;
    Another parameter in the rotate method to specify a rotation point would be nice.  Still, this works just fine, so no complaints from me.

  • 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

  • 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

  • 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!

  • After creating a playlist, it becomes locked or frozen and I cannot move the songs around in different order.

    After creating a playlist, it becomes locked or frozeen and I cannot move the songs around in different order.

    Select the very first column header (above the numbers) and then try it.

  • Black border around my mouse pointer

    Since a few days, I have a thick black border around my mouse pointer, always following the movement of the pointer. How can I bring this away?
    Thanks for help
    Ueli

    Welcome to Discussions - you need to go to System Prefs>Universal Access>Zoom, turn it OFF and make sure, that under Zoom options "show preview rectangle" is UNchecked.
    Please post back and tell us if this works,
    Miriam

  • HT203164 I tried my first Windows CD burn with iTunes; the burn fails at different points in the burn with error codes 4450 or 4280.

    I tried my first Windows CD burn with iTunes; the burn fails at different points during the burn, with error codes 4450 or 4280.

    I have the same problem, after years of everything working great. Last time this happened I tried using a different brand of CD and it worked, but I must warn you that now iTunes rejects all three brands I have been trying to use.

  • Measuring power at two different point (single phase)

    Hi all,
    I am new user of LabVIEW 2013 with electrical power suite.
    May i know how to measure two different point of single phase system using the same VI such as in DAQ power and energy example?
    As I notice that there are several type of wiring available. Is only one voltage and one current availabe during 1 ph voltage and 1 current selection. Thus, when I select 3ph voltage and 2 current, the value I obtain is not seem to be true.
    From the figure attached, I want to measure the voltage at current at the solar/PV  to obtain the power value. Other than that, I also need to measure the voltage and current at the load such as water heater. This is a single phase configuration network.
    (2 voltage and 2 current measurement at single phase)
    Hope for guidance.

    Hi Lewis,
    Here attached the file.
    Actually I wanted to measure power two different point in a single phase system as shown in the first attachement.
    Since, there is example in power quality measurement(DAQ) as shown in the second attachment.
    since there is two measuring point in my measurement. May i know how to obtain two measurement voltage at the same time in DAQ?
    Hope for guidance.
    Attachments:
    Two measuremernt point (single phase).png ‏7 KB
    power & energy measurement.jpg ‏172 KB

Maybe you are looking for

  • Pgi is not happening in sto

    Dear SAP Gurus, Depot sales Scenario: 1. Sales order in depot: Sales doc type ZDEP. 2. Release P.R 3. Create S.T.O: Doc type ZPPO 4. Create replenishment delivery 5. Proforma invoice. 6. Goods receipt at depot: MIGO 7. Delivery to customer from depot

  • Inventory management in plant

    Dear All,              I am facing problem while performing STO, It is showing error that BAPI Material not subject to inventory management in    Plant XYZ.           Please help me out. Thanks in advance for ur valuable input. Regards AJIT K SINGH

  • Save_text function module for multiple entries

    HI friends, Iam facing a following senario. Iam using save text function module  ie: save_text to save the sales text for the line items in va01 transaction. Iam able save the text for single entry but iam not able to save the text for muliple entrie

  • IMac does not boot beyond apple logo - help

    My circa 2006 Intel-processor iMac does not get beyond the white screen with the Apple logo and the spinning wheel when I power it on. As per other support documents (Article: HT1533; discussion "Mac doesn't boot") I have tried and SMC reset, all of

  • Printing different & Specific image sizes on a 17x22 contact sheet. pls...

    Good day. I'd like to print some specific sizes on one sheet of 17x22 paper (3800) as not to waste paper. So I'd like to print a 8x10, several 3.5 x 5 etc on one sheet if possible but cant figure it out. Oh, These would be different images on the sam