Model rotation about multiple axis

Can anyone tell me how I can limit the rotation of a model to
a specific angle without using camera rotation?
I do know how to limit the rotation when the model has only
been rotated in one axis (simple maths comparison of either x, y,
or z depending on which axis I've rotated the model about).
But, how do you limit rotation when the model has already
been rotated about 1 or 2 of the other axes given that x, y, and z
keep changing their values and axisAngle doesn't always give
appropriate values?

Using parent/childs is one way to work around relative
rotation problems. Parent the model you are trying to limit
rotation on to a dummy model (or group). Keep the dummy at
rotation(0, 0, 0), and rotate the target model to its correct
orientation in your scene. Then monitor the dummy's rotation to
keep it within your limits.

Similar Messages

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

  • Transform combination for rotation about arbitrary axis

    I have read through many of the postings about rotations around axes other than ones going through the origin, and they list various solutions. I tried using the method where an object is translated to the origin, rotated, and then translated back to its original position.
    When using this method, does each translation and rotation need to be in a separate TransformGroup, or can one TransformGroup use three Transform3D objects multiplied together to reach the same result?
    Thanks for any additional info anyone can provide.

    You can use only one TransformGroup with the combined transformation. However if you change something you have to recalculate the overal transformation again. Thus you have to store the translation and rotation values. If you use seperate TransformGroups Java3D is calculating the overal transformation for you. In this case: if the capability bits which allow changes to the Trasnformation are NOT set and the scene graph is compiled, then j3d will internally hold only the combined transformation, so you don't loose any performance.

  • Rotating Sprite Center Axis

    Hi,
    I found an interesting tutorial (link) and created a working model, adapting it as needed.
    So far, when I center the container sprite and rotate it, it appears to first rotate from a 0,0 registration point, instead of from its center. I've tried to changet he sprite's registration point, but so far this hasn't worked/helped. Nothing else has worked to fix this rotation problem.
    I must be doing something wrong.
    Here's the AS3 (to view, add to first frame of new FLA, 1024X768 stage, color black). Rotation segments below are commented as       //ROTATION.:
    import flash.display.Sprite;
        import flash.events.MouseEvent;
        import flash.events.Event;
        import flash.text.TextField;
        //import flash.geom.ColorTransform;
    stop();
        //public class bejewelled extends Sprite {
            var gems_array:Array=new Array();
            var aGem:Sprite;
            var selectorBox:Sprite=new Sprite();
            var selectorRow:int=-10;
            var selectorColumn:int=-10;
            var red:uint = 0xFF0000;
            var green:uint = 0xFF00;
            var blue:uint = 0xFF;
            var yellow:uint = 0xFFFF00;
            var cyan:uint = 0xFFFF;
            var magenta:uint = 0xFF00FF;
            var white:uint = 0xFFFFFF;
            var colours_array:Array=new Array(red,green,blue,yellow,cyan,magenta,white);
            var clickPossible:Boolean=false;
            var score_txt:TextField=new TextField();
            var hint_txt:TextField=new TextField();
            var score:uint=0;
            var inaRow:uint=0;
            var match:Boolean = true;
            var gemSize:uint = 96;
            var format:TextFormat = new TextFormat();
            var rotate:Boolean=false;
            var container:Sprite = new Sprite(); // Create the container sprite
             //var newColorTransform:ColorTransform = exitBtn.transform.colorTransform;
            //newColorTransform.color = 0xff0000;
            //exitBtn.transform.colorTransform = newColorTransform;
            function bejewelled() {
                // Game initiation
                format.size = 40;
                format.font = 'Arial';
                // Create and style score text
                addChild(score_txt);
                score_txt.textColor=0xFFFFFF;
                score_txt.x=gemSize*9.6;
                score_txt.autoSize = TextFieldAutoSize.LEFT;
                score_txt.defaultTextFormat = format;           
                // Create and style hint text
                addChild(hint_txt);
                hint_txt.textColor=0xFFFFFF;
                hint_txt.x=gemSize*9.6;
                hint_txt.y=gemSize;
                hint_txt.autoSize = TextFieldAutoSize.LEFT;
                hint_txt.defaultTextFormat = format;
                // Create Gems in rows and columns
                addChild(container); // Add the container to the display list (stage)
                for (var i:uint=0; i<8; i++) {
                    gems_array[i]=new Array();
                    for (var j:uint=0; j<8; j++) {
                        do {
                            gems_array[i][j]=Math.floor(Math.random()*7);
                            while (rowLineLength(i,j)>2 || columnLineLength(i,j)>2);
                        aGem=new Sprite();
                        aGem.graphics.beginFill(colours_array[gems_array[i][j]]);
                        aGem.graphics.drawCircle(gemSize/2,gemSize/2,gemSize/2.07);
                        aGem.graphics.endFill();
                        aGem.name=i+"_"+j;
                        aGem.x=j*gemSize;
                        aGem.y=i*gemSize;
                        container.addChild(aGem);
                //Center the container sprite
                container.width = container.width - 10;
                container.height =  container.height - 10;           
                container.x = (stage.stageWidth-container.width)/2;
                container.y = (stage.stageHeight-container.height)/2;
                // Create and style selector box
                container.addChild(selectorBox);
                selectorBox.graphics.lineStyle(2,red,1);
                selectorBox.graphics.drawRect(0,0,gemSize,gemSize);
                selectorBox.visible=false;
                // Listen for user input
                container.addEventListener(MouseEvent.CLICK,onClick);
                addEventListener(Event.ENTER_FRAME,everyFrame);
            // Every frame...
            function everyFrame(e:Event):void {
                //Assume that gems are not falling
                var gemsAreFalling:Boolean=false;
                // Check each gem for space below it
                for (var i:int=6; i>=0; i--) {
                    for (var j:uint=0; j<8; j++) {
                        // If a spot contains a gem, and has an empty space below...
                        if (gems_array[i][j] != -1 && gems_array[i+1][j]==-1) {
                            // Set gems falling
                            gemsAreFalling=true;
                            gems_array[i+1][j]=gems_array[i][j];
                            gems_array[i][j]=-1;
                            trace("#");
                            trace(i+"_"+j);
                            container.getChildByName(i+"_"+j).y+=gemSize;
                            container.getChildByName(i+"_"+j).name=(i+1)+"_"+j;
                            break;
                    // If a gem is falling
                    if (gemsAreFalling) {
                        // don't allow any more to start falling
                        break;
                // If no gems are falling
                if (! gemsAreFalling) {
                    // Assume no new gems are needed
                    var needNewGem:Boolean=false;
                    // but check all spaces...
                    for (i=7; i>=0; i--) {
                        for (j=0; j<8; j++) {
                            // and if a spot is empty
                            if (gems_array[i][j]==-1) {
                                // now we know we need a new gem
                                needNewGem=true;
                                // pick a random color for the gem
                                gems_array[0][j]=Math.floor(Math.random()*7);
                                // create the gem
                                aGem=new Sprite();
                                aGem.graphics.beginFill(colours_array[gems_array[0][j]]);
                                aGem.graphics.drawCircle(gemSize/2,gemSize/2,gemSize/2.07);
                                aGem.graphics.endFill();
                                // ID it
                                aGem.name="0_"+j;
                                // position it
                                aGem.x=j*gemSize;
                                aGem.y=0;
                                // show it
                                container.addChild(aGem);
                                // stop creating new gems
                                break;
                        // if a new gem was created, stop checking
                        if (needNewGem) {
                            break;
                    // If no new gems were needed...
                    if (! needNewGem) {
                        // assume no more/new lines are on the board
                        var moreLinesAvailable:Boolean=false;
                        // check all gems
                        for (i=7; i>=0; i--) {
                            for (j=0; j<8; j++) {
                                // if a line is found
                                if (rowLineLength(i,j)>2 || columnLineLength(i,j)>2) {
                                    // then we know more lines are available
                                    moreLinesAvailable=true;
                                    // creat a new array, set the gem type of the line, and where it is
                                    var lineGems:Array=[i+"_"+j];
                                    var gemType:uint=gems_array[i][j];
                                    var linePosition:int;
                                    // check t's a horizontal line...
                                    if (rowLineLength(i,j)>2) {
                                        // if so, find our how long it is and put all the line's gems into the array
                                        linePosition=j;
                                        while (sameGemIsHere(gemType,i,linePosition-1)) {
                                            linePosition--;
                                            lineGems.push(i+"_"+linePosition);
                                        linePosition=j;
                                        while (sameGemIsHere(gemType,i,linePosition+1)) {
                                            linePosition++;
                                            lineGems.push(i+"_"+linePosition);
                                    // check t's a vertical line...
                                    if (columnLineLength(i,j)>2) {
                                        // if so, find our how long it is and put all the line's gems into the array
                                        linePosition=i;
                                        while (sameGemIsHere(gemType,linePosition-1,j)) {
                                            linePosition--;
                                            lineGems.push(linePosition+"_"+j);
                                        linePosition=i;
                                        while (sameGemIsHere(gemType,linePosition+1,j)) {
                                            linePosition++;
                                            lineGems.push(linePosition+"_"+j);
                                    // for all gems in the line...
                                    for (i=0; i<lineGems.length; i++) {
                                        // remove it from the program
                                        container.removeChild(container.getChildByName(lineGems[i]));
                                        // find where it was in the array
                                        var cd:Array=lineGems[i].split("_");
                                        // set it to an empty gem space
                                        gems_array[cd[0]][cd[1]]=-1;
                                        // set the new score
                                        score+=inaRow;
                                        // set the score setter up
                                        inaRow++;
                                    // if a row was made, stop the loop
                                    break;
                            // if a line was made, stop making more lines
                            if (moreLinesAvailable) {
                                break;
                        // if no more lines were available...
                        //ROTATION
                        if (! moreLinesAvailable) {
                            if(rotate){
                                container.rotation+=5;                           
                                if(container.rotation%90==0){
                                    rotate=false;
                                    container.rotation=0;
                                    rotateClockwise(gems_array);
                                    while(container.numChildren>0){
                                        container.removeChildAt(0);
                                    for (i=0; i<8; i++) {
                                        for (j=0; j<8; j++) {
                                            aGem=new Sprite();
                                            aGem.graphics.beginFill(colours_array[gems_array[i][j]]);
                                            aGem.graphics.drawCircle(gemSize/2,gemSize/2,gemSize/2.07);
                                            aGem.graphics.endFill();
                                            aGem.name=i+"_"+j;
                                            aGem.x=j*gemSize;
                                            aGem.y=i*gemSize;
                                            container.addChild(aGem);                                       
                                            container.addChild(selectorBox);
                                            selectorBox.graphics.lineStyle(2,red,1);
                                            selectorBox.graphics.drawRect(0,0,gemSize,gemSize);
                                            selectorBox.visible=false;
                            else{
                                // allow new moves to be made
                                clickPossible=true;
                                // remove score multiplier
                                inaRow=0;
                // display new score
                score_txt.text=score.toString();
            // When the user clicks
            function onClick(e:MouseEvent):void {
                // If a click is allowed
                if (clickPossible) {
                    // If the click is within the game area...
                    if (mouseX<container.x+gemSize*8 && mouseX>0 && mouseY<container.y+gemSize*8 && mouseY>0) {
                        // Find which row and column were clicked
                        var clickedRow:uint=Math.floor((mouseY-container.y)/gemSize);
                        //var clickedRow:uint=Math.floor(e.target.y/gemSize);
                        var clickedColumn:uint=Math.floor((mouseX-container.x)/gemSize);
                        //var clickedColumn:uint=Math.floor(e.target.x/gemSize);
                        // Check if the clicked gem is adjacent to the selector
                        // If not...
                        if (!(((clickedRow==selectorRow+1 || clickedRow==selectorRow-1)&&clickedColumn==selectorColumn)||((clickedColumn==selectorColumn+1 || clickedColumn==selectorColumn-1) && clickedRow==selectorRow))) {
                            // Find row and colum the selector should move to
                            selectorRow=clickedRow;
                            selectorColumn=clickedColumn;
                            // Move it to the chosen position
                            selectorBox.x=gemSize*selectorColumn;
                            selectorBox.y=gemSize*selectorRow;
                            // If hidden, show it.
                            selectorBox.visible=true;
                        // If it is not next to it...
                        else {
                            // Swap the gems;
                            swapGems(selectorRow,selectorColumn,clickedRow,clickedColumn);
                            // If they make a line...
                            if (rowLineLength(selectorRow,selectorColumn)>2 || columnLineLength(selectorRow,selectorColumn)>2||rowLineLength(clickedRow,clickedColumn)>2 || columnLineLength(clickedRow,clickedColumn)>2) {
                                // remove the hint text
                                hint_txt.text="";
                                // dis-allow a new move until cascade has ended (removes glitches)
                                clickPossible=false;
                                // move and rename the gems
                                container.getChildByName(selectorRow+"_"+selectorColumn).x=e.target.x;//clickedColumn*gemSize;
                                container.getChildByName(selectorRow+"_"+selectorColumn).y=e.target.y;//clickedRow*gemSize;
                                container.getChildByName(selectorRow+"_"+selectorColumn).name="t";
                                container.getChildByName(clickedRow+"_"+clickedColumn).x=selectorColumn*gemSize;
                                container.getChildByName(clickedRow+"_"+clickedColumn).y=selectorRow*gemSize;
                                container.getChildByName(clickedRow+"_"+clickedColumn).name=selectorRow+"_"+selectorColumn;
                                container.getChildByName("t").name=clickedRow+"_"+clickedColumn;
                                match = true;
                                rotate = true;
                            // If not...
                            else {
                                // Switch them back
                                swapGems(selectorRow,selectorColumn,clickedRow,clickedColumn);
                                match = false;
                            if (match) {
                                // Move the selector position to default
                                selectorRow=-10;
                                selectorColumn=-10;
                                // and hide it
                                selectorBox.visible=false;
                            else {
                                // Set the selector position
                                selectorRow=clickedRow;
                                selectorColumn=clickedColumn;
                                // Move the box into position
                                selectorBox.x=gemSize*selectorColumn;
                                selectorBox.y=gemSize*selectorRow;
                                match = false;
                                // If hidden, show it.
                                selectorBox.visible=true;
                    // If the click is outside the game area
                    else {
                        // For gems in all rows...
                        for (var i:uint=0; i<8; i++) {
                            // and columns...
                            for (var j:uint=0; j<8; j++) {
                                // if they're not too close to the side...
                                if (i<7) {
                                    // swap them horizontally
                                    swapGems(i,j,i+1,j);
                                    // check if they form a line
                                    if ((rowLineLength(i,j)>2||columnLineLength(i,j)>2||rowLineLength(i+1,j)>2||columnLineLength(i+1,j)>2)) {
                                        // if so, name the move made
                                        selectorBox.x = j*gemSize;
                                        selectorBox.y = i*gemSize;
                                        selectorBox.visible = true;
                                        hint_txt.text = (i+1).toString()+","+(j+1).toString()+"->"+(i+2).toString()+","+(j+1).toString();
                                    // swap the gems back
                                    swapGems(i,j,i+1,j);
                                // then if they're not to close to the bottom...
                                if (j<7) {
                                    // swap it vertically
                                    swapGems(i,j,i,j+1);
                                    // check if it forms a line
                                    if ((rowLineLength(i,j)>2||columnLineLength(i,j)>2||rowLineLength(i,j+1)>2||columnLineLength(i,j+1)>2) ) {
                                        // if so, name it
                                        selectorBox.x = j*gemSize;
                                        selectorBox.y = i*gemSize;
                                        selectorBox.visible = true;
                                        hint_txt.text = (i+1).toString()+","+(j+1).toString()+"->"+(i+1).toString()+","+(j+2).toString();
                                    // swap the gems back
                                    swapGems(i,j,i,j+1);
            //Swap given gems
            function swapGems(fromRow:uint,fromColumn:uint,toRow:uint,toColumn:uint):void {
                //Save the original position
                var originalPosition:uint=gems_array[fromRow][fromColumn];
                //Move original gem to new position
                gems_array[fromRow][fromColumn]=gems_array[toRow][toColumn];
                //move second gem to saved, original gem's position
                gems_array[toRow][toColumn]=originalPosition;
            //Find out if there us a horizontal line
            function rowLineLength(row:uint,column:uint):uint {
                var gemType:uint=gems_array[row][column];
                var lineLength:uint=1;
                var checkColumn:int=column;
                //check how far left it extends
                while (sameGemIsHere(gemType,row,checkColumn-1)) {
                    checkColumn--;
                    lineLength++;
                checkColumn=column;
                //check how far right it extends
                while (sameGemIsHere(gemType,row,checkColumn+1)) {
                    checkColumn++;
                    lineLength++;
                // return total line length
                return (lineLength);
            //Find out if there us a vertical line
            function columnLineLength(row:uint,column:uint):uint {
                var gemType:uint=gems_array[row][column];
                var lineLength:uint=1;
                var checkRow:int=row;
                //check how low it extends
                while (sameGemIsHere(gemType,checkRow-1,column)) {
                    checkRow--;
                    lineLength++;
                //check how high it extends
                checkRow=row;
                while (sameGemIsHere(gemType,checkRow+1,column)) {
                    checkRow++;
                    lineLength++;
                // return total line length
                return (lineLength);
            function sameGemIsHere(gemType:uint,row:int,column:int):Boolean {
                //Check there are gems in the chosen row
                if (gems_array[row]==null) {
                    return false;
                //If there are, check if there is a gem in the chosen slot
                if (gems_array[row][column]==null) {
                    return false;
                //If there is, check if it's the same as the chosen gem type
                return gemType==gems_array[row][column];
               //ROTATION
               function rotateClockwise(a:Array):void {
                var n:int=a.length;
                for (var i:int=0; i<n/2; i++) {
                    for (var j:int=i; j<n-i-1; j++) {
                        var tmp:String=a[i][j];
                        a[i][j]=a[n-j-1][i];
                        a[n-j-1][i]=a[n-i-1][n-j-1];
                        a[n-i-1][n-j-1]=a[j][n-i-1];
                        a[j][n-i-1]=tmp;
    bejewelled();  
    Any help appreciated.

    OK, way too much code. By default, everything will rotate from top left. If you want to change that you need to change the positions of the content within the container, not the container itself.
    For example if you do something like this:
    var a:Sprite = new Sprite(); //container
    addChild(a);
    a.x = 100; a.y = 100;
    var b:MovieClip = new car(); //clip from library
    a.addChild(b);
    addEventListener(Event.ENTER_FRAME, up);
    function up(e:Event):void
              a.rotation += 1;
    The car added to the container will rotate about it's top left point... because that's where the container rotates about. To fix, move the car so the containers top/left is at the car's center like so:
    var a:Sprite = new Sprite();
    addChild(a);
    a.x = 100; a.y = 100;
    var b:MovieClip = new car();
    a.addChild(b);
    b.x -= b.width / 2;
    b.y -= b.height / 2;
    addEventListener(Event.ENTER_FRAME, up);
    function up(e:Event):void
              a.rotation += 1;
    You'll notice all that changed is moving the car 1/2 it's width and height.
    HTH

  • Shortcut for brush rotation & better 3D model rotation/movement

    I'm pretty amazed that this still hasn't been added in. Just a nice simple shortcut to rotate the brush(and have the cursor reflect its current rotation) would really help instead of constantly having to go into the brush settings and play guess the angle. An option to determine the amount of degree's to rotate it by per shortcut push somewhere in the toolbars would be nice as well.
    Also for the 3d model rotation/movement...why not use a a simple scheme like Maya or 3DMax. Its such a pain to move that I'd rather learn Zbrush or Mudbox or even do it the old fashion way and paint it on a 2d plane....
    Thanks!

    For the sun I would recommend drawing it as an image attached to the background initially and having a DirectionalLight coming from the same direction. That should create the solar effect you are looking for.
    A while ago someone created quite an interesting space flight demo in J3D which used lens flare effects. I think it was posted through the Java3D mailing list so it may be worth looking at the archive for posts about it - I think it probably came out last autumn some time.

  • Chart Multiple Axis

    I have seen the flex's chart documentation about multiple
    axes.
    In this documentation the example speak about single
    horizontal axis and multiple vertical axes.
    The question is: may i have multiple horizontal axis? Has it
    sense?
    Thank you

    Sorry, i give response by my self.. i can use
    labelfunction...

  • HT1206 Lots of info about one user using multiple computers. What about multiple users with separate Apple IDs using same computer? Having problems getting my wifes new iPhone talking to her apple account on the computer we share (2 users)

    Lots of info about one user using multiple computers. What about multiple users with separate Apple IDs using same computer? Having problems getting my wifes new iPhone talking to her apple account on the computer we share (2 users)

    You need to create a user account for your wife (or yourself depending on who has the current user account). When syncing, each of you should sign in as a separate user, login to iTunes and then sync. I had this problem when my sister got an iPhone. When we did her initial sync, everything on my iPhone showed up on hers. Apple gave me this solution.

  • Change labels of multiple axis in xy-chart

    Hi,
    I want to programmatically change the labels of the axes in a xy-chart with two y-axes.
    I can easily manage this for the x-axis and the first y-axis. But I can't find how to access the properties of the second y-axis. How to do this?
    Steven
    LV 7.1 - 8.2

    There is a property named "Active Y Scale".
    In dictates which of the multiple axis you are going to act on.
    Set it to the index of the axis you want to change BEFORE setting the label.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to go about multiple inclination with different data selection in Delta

    We have to copy large amount of data ( more than 42lak of recodes) selectivly from on ODS to other ODS. in delata load ( BW 3.5 enverioment)
    I thought of loading data in slices through delta loading with selection condition.
    step 1> Do The initialization with selection condition as for calyear =2001 ( Init without data transfer )
    step 2> Take the delta load .. it will take all delta record with same selection
    step 3> Now I want to do Initialization with selection condition as for calyear =2002
    step 4> take the delta now it will take delta for year 2001 and 2002 both Right ?
    Here what problem I am facing.. while doing 2nd time initialization it prompt me to delete the last  initialization request form scheduler menu.
    if i delete the last request .. will it take the delta  for previous initialization selection  and new initialization selection. ?
    Please advice how to go about multiple inclination with different data selection in delta loading.
    Looking forward your reply.

    Hi,
    step 1> Do The initialization with selection condition as for calyear =2001 ( Init without data transfer )
    step 2> Take the delta load .. it will take all delta record with same selection
    step 3> Now I want to do Initialization with selection condition as for calyear =2002
    step 4> take the delta now it will take delta for year 2001 and 2002 both Right ?
    You are correct with this scenario normally. The message you mentioned normally comes up when you open a infopackage and don't change the selection first or in case you have overlapping selections with an already done init.
    regards
    Siggi

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

  • Rotation and Z axis tracking

    Here's my test:
    http://media.putfile.com/shaketrack
    As you can see, X and Y tracking work fine.
    However, how can I do rotation and Z axis tracking?

    You need a two point track and you need to tell Shake to interpret the information as rotation, size, or both...
    Patrick

  • Rotate to z axis

    How to use Behavior to rotate to z axis?

    You are so brief, this is the best I can tell you:
    Use a Transform3D that you put into a TransformGroup node placed over the brach that has to be rotated, and make your behaviour create a new Transform3D o change the already existing one and then set whichever of both you choose, again in the TransformGroup. This basically descrives the general method to change a trasnformation, just make your behaviour do it on your own criteria (on key presses, mouse movement, time, etc.)
    Anyway there are some predefined behaviours you could benefit from, check the tutorials.
    Regards

  • Question about multiple application modules.

    Hello,
    Suppose I have 2 database schema’s. For both schemas I have 1 application module. All view objects are in the same project.
    For each application module I have an application definition.
    Is it possible to link between these two applications? Because sometimes these database schema’s link to each other and you would like to jump from one application directly to the other.
    For example you have orders locates in 1 DB schema and customers in another DB schema.
    You would want to jump from the order directly to the customer details in the second schema.
    Is this possible? Or do I need to make nested application modules etc?
    I can find very little info about this; the JHS def guide does not offer much information about multiple application modules etc.
    -Anton

    Anton,
    Yes, you can jump aroundd as you like.
    You just can't use view links between VO's based on different db schema tables.
    Nesting AM's doesn't help there, the DB connection of the top-level AM will be used.
    Why don't you create synomyms for the tables in the other schema?
    Steven Davelaar,
    JHeadstart Team.

  • Another Question...rotating on two axis

    Hi again. Well I have yet another question...how do I set a translation to rotate on two axis? Like I know that I can do:
    TransformGroup tg;
    Transform3D t3d = new Transform3D();
    t3d.setRotation(new AxisAngle4f(1f,0f,0f,(some angle)));
    tg.setTransform(t3d);
    for one axis (I just put the declarations in to show an example) but if I try to apply two set rotations or two Transform3D's it doesn't work...so how would I rotate on, say, both the x and the y axis? Thanks,
    Compaq

    in fact the best thing would be to get used to quaternions. I suppose some Java3D tutorials discribe it quite well.
    If you really want to use rotation on axis you have two solutions :
    create 2 Transform3D and apply the result
    Transform3D t3dx = new Transform3D();
    t3dx.setRotation(new AxisAngle4f(1f,0f,0f,(xangle)));
    Transform3D t3dy = new Transform3D();
    t3dy.setRotation(new AxisAngle4f(0f,1f,0f,(yangle)));
    t3dx.mul(t3dy);
    tg.setTransform(t3dx);
    (hum, at least i suppose it would work ;)
    or you can do that too :
    Transform3D t3dx = new Transform3D();
    t3d.setRotation(new AxisAngle4f(1f,yangle/xangle,0f,(xangle)));
    tg.setTransform(t3d);
    (in this case xangle must be != 0)
    I'm not really sure it will work so please tell me if it works. I've tried to help you twice today so you can send me some bucks to the folowing address :
    oh, ok mum i won't give our address on the internet ;)
    c ya
    GnG

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

Maybe you are looking for