Rotation of an object
Hi All,
I am facing a problem while rotating an object in my application.
Transform3D t3d = new Transform3D();
t3d.set(new Vector3f(3.57f, 0.25f, 0.75f));
TransformGroup tg = new TransformGroup(t3d);
tg.addChild(new Box(width, height, length, obstacleApp));I have tried
t3d.rotY(0.4f);
but it is not postilion it in right place.
I want to rotate this box with an angle to different direction
please suggest me the way to do it.
vivek
tigerkumar wrote:
Hi All,
I am facing a problem while rotating an object in my application.
Transform3D t3d = new Transform3D();
t3d.set(new Vector3f(3.57f, 0.25f, 0.75f));
TransformGroup tg = new TransformGroup(t3d);
tg.addChild(new Box(width, height, length, obstacleApp));I have tried
t3d.rotY(0.4f);
but it is not postilion it in right place.
I want to rotate this box with an angle to different direction
please suggest me the way to do it.
vivekyou have to update the transformGroup after you change the Transform3D
Try this tg.setTransform(t3d);
I haven't tried this code so it may have some errors.
Venkat
Similar Messages
-
Re: Bug SDK-17114 flex.effects.Rotate - Selection Glow Is
Rotated For All Objects (Not Just Effect.Target) at
http://bugs.adobe.com/jira/browse/SDK-17114.
Looks like this bug was fixed as of yesterday - I'd like to know
when there will be a patch available to users. I bought Flex 3 just
in the last few weeks, so it would be nice if I could get a free
patch. However, my main concern is how to do a workaround. I can't
deliver my application with this problem, and if the patch is not
available, I don't have an alternative. Is there a way to access
the selection rectangle object and set its rotation
explicitly?Thanks, Michel.
I forgot to mention one point about copying shape layers into one shape layer: when you initially use the Shape Selection tool to select a shape for cutting, make sure the option for the Shape Selection tool is set to "Add to Selection".
MichelBParis wrote:
The problem with Elements+ is that it has so many features you soon forget what it can give you !
Truer words were never spoken!
Ken -
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:
edwardrSince 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 -
This has happened to me a number of times. Photoshop CC prevents me from rotating the object, I can still move the camera around but not rotate. I cant even select the 3D object. Ive check and caps lock is not on.
Im using Photoshop CC on and Imac running Mountian Lion.
helpWhat object? What else? You need to provide more info and possibly screenshots. It could be choking on textures or something like that...
Mylenium -
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! -
Rotating and Translating Objects with Collision Modifiers
Hello
Im trying to build a simple 3d scene. The idea being that a
footballer walks up to a football and on detection of that
collision, the football is translated or 'kicked.'
Got the Collision Detection working using Collision
Modifiers. Got it working so that it registers the collisions, what
I havent gotten is how to translate the object (football) I have
used the simple translate command but this seems to work on objects
without collision modifiers.
Does anyone have any work arounds?
Thanks in AdvanceHello
Im trying to build a simple 3d scene. The idea being that a
footballer walks up to a football and on detection of that
collision, the football is translated or 'kicked.'
Got the Collision Detection working using Collision
Modifiers. Got it working so that it registers the collisions, what
I havent gotten is how to translate the object (football) I have
used the simple translate command but this seems to work on objects
without collision modifiers.
Does anyone have any work arounds?
Thanks in Advance -
Can You Change 3D Object Rotation Axis?
Greetings. I have created a 3d object using repousse in Photoshop (CS5 extended). The original 2d image was created in Illustrator. I have found that in both Photoshop and After Effects, when I rotate this object in 3D space, either rotating the object itself or the camera, that the axis upon which it rotates is not the 3D center of the 3D object, but rather somewhere behind it. The result is that it is rotating like the moon rotates around the earth, rather than rotating in place, like an eye moving (rotating) in an eye socket; i want the eye ball to stay in one place, but see the pupil move up and down and all around like a real eye would.
I have had no luck changing anchor points or positions of the object, even though I do have the X, Y, Z coordinates to manipulate.
Can you tell me how to adjust this anchor point, or rotation axis point, or whatever this would be called?
Thanks.Not really true...
Yes it is limited but it can be altered.
I believe that photoshops 3d center point is based on the world center and not the objects center. This means that it is possibloe to move the object to the world center to fix the rotation of your object.
Open window>3d panel and just below the layers in that panel are some icon at the left side of the panel. Third icon down is the mesh tool, hold down the mouse button to bring up the pop up menu. Select the slide mesh tool. This will let you move the mesh adjust the pivot point.
The problem that I see with this, is that it is trial by error, I do not see away to visually see where the world center is.
Scratch that, at the bottom of the panel are three icons. The left of the three will turn on the ground plane. The plane does show world center.(where the red and green lines intersect is world zero)
To understand which axis is which, sinse it does not specify. Select the 3d pan tool, then in the top tool bar, type in a value one axis at a time to see which direction the object is moving. Then repeat the process for the rotate tool and see how the object rotates around each axis. -
Rotate a Object Around Center Axis
Hey peoples, new to flash here. I'm using CS3 with ActionScript 3.0. What I want is simple, and I've done some searching but nothing that can get me the right results. I'm going to post a link that does exactly what I want:
http://www.newgrounds.com/dump/item/d25a3dd46f2ff49f2ec892c425cbbd1e
This rotates the circular object around a center point in a way that you can distort the object yet is still remains turning in a circular motion. A simple motion tween rotating the image will only work if the object is perfectly round, so distorting the object to make it more straight or curved won't work with a simple tween. I want to do exactly what is happening here (with my own object), is there some AS3 behind the scenes here making this turn on a center point?? Thanks for the helpYes, but I still don't know what you mean by the parent child relationship. Lets say I use a simple rotate line like:
objectname.rotation = 360;
That should spin it, but how do I spin it correctly if the object is skewed like in the bottom right picture of my example? -
I am attempting to animate the rotation of an object using Photoshop CC Animation. However, unlike in previous versions where there was a "3D Object Position" layer on the Timeline that one would keyframe to change an objects position within the scene; the sublayer "3D Object Position" does not exist in CC. I have attempted to change an objects rotation by keyframing the "Position" sublayer resulting in no change what so ever. I have attempted to change an objects rotation by keyframing the "3D Meshes" sublayer resulting in the object rotating clear off the scene and not following the coordinates that I type in. This is very frustrating since something like this use to be so easy!! How do I animate the rotation of an object using Photoshop CC?!
Which version of CC and have you install the updates?
Supply pertinent information for quicker answers
The more information you supply about your situation, the better equipped other community members will be to answer. Consider including the following in your question:
Adobe product and version number
Operating system and version number
The full text of any error message(s)
What you were doing when the problem occurred
Screenshots of the problem
Computer hardware, such as CPU; GPU; amount of RAM; etc. -
Click, animate rotation of Object by +90° via AS3?
I have a button that will rotate an object in its parent by 90 degrees every time its clicked:
b_rotate_CW.addEventListener(MouseEvent.CLICK, rotateCW);
function rotateCW(event:MouseEvent):void
Object(this).parent.module.rotation += 90;
Which is fine, but I think it would be a nice touch if the object's rotation were animated.
I tried this:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
b_rotate_CW.addEventListener(MouseEvent.CLICK, rotateCW);
function rotateCW(event:MouseEvent):void
var rCW:Tween = new Tween(Object(this).parent.module, "rotate", Strong.easeOut, 0, +90, .5, true);
... but it does nothing at all, I am guessing that "rotate" is a property option, I can find no documentation for that, only x, y, their scale and alpha.
I'm sure this has been done by many, can anyone offer a helpful clue as to how this function would be properly coded?
Thanks!Thats brilliant, I tweaked it a little; replaced the 0 with the current angle of the clip) and now it works perfectly:
var rCW:Tween;
b_rotate_CW.addEventListener(MouseEvent.CLICK, rotateCW);
function rotateCW(event:MouseEvent):void
rCW = new Tween(Object(this).parent.module, "rotation", Strong.easeOut, Object(this).parent.module.rotation, Object(this).parent.module.rotation+90, .5, true);
Who would have known you could use a target path in place of a value?
Where can everyone learn AS3 as you know it?
Thank you again for your immense help! -
Possible to creat a group of 3d objects and rotate each based on group's axis?
I need to create an extruded rectangle. On the face of that rectangle needs to be another extruded rectangle. I'd like to be able to rotate both seperate objects in 3d based upon the same axis. Is this possible? I've played around with the 3d effects and cant seem to get this to work.
An alternative can be: Make one rectangle and apply the Extrude effect. Drag it in the Symbols panel so as to make it a Symbol. Now draw another rectangle and apply the Extrude effect. In the Extrude dialog, use Map Art to map the symbol (of extruded rectangle).
If you want to rotate them both along the same axis, either open the Appearance panel and change the already applied Extrude effect to rotate , or,
Edit the symbol and rotate as required (this will reflect in the the whole doc) and rotate the another rectangle separately using Rotate tool.
I hope it helps. -
How can i view the angle of a rotated object?
ok, so i have rotated an object manually (not by entering a numberic value), and i now want to rotate something by exactly the same degree. how can i do this?
am working in AI CS3.
many thanks.If by "manually" you mean you dragged with the Rotate Tool, and the rotation you want to replicate is the one you just made, you can just doubleClick the Rotate Tool. The last-used rotation value will be recorded there, even if the rotation was done manually by dragging the tool.
If by "manually" you mean you dragged with the black pointer just outside the bounding box corner, then you can repeat the rotation on another object by selecting the other object and typing Ctrl D (Transform Again). That will rotate the newly selected object the same amount, but also about the same center. So you may have to reposition it.
JET -
Hello,
i have developed a smartform, but the customer need printing the form rotated 90º to left. I have set up the page to landscape format but i don´t know how to rotate the others object of the form.
How can i do it?
Thanks.hi,
try the following steps :-
1. Goto your PAGE node.
2. double-click it.
3. under 3 tabs, there is middle tab 'OUTPUT OPTIONS'
4. In that u will have 2 RADIO BUTTONS
In that choose
LANDSCAPE FORMAT.
hope it helps !!!!!!!!
regards,
prashanti -
Rotate gradient fills along with an object
I created an object with gradient fills. I grouped all of the elements in the object.
When I try to rotate the object, the gradient fills do not rotate with the object. An element that was transformed by: Effects->Warp->Arc also doesn't rotate as I would expect.
Is there a way to tell Illustrator to rotate an object and keep it looking like it did before the rotate?
(I'm using Illustrator CS5 on Windows XP.)
Thanks!Regarding rotation of an ordianry grad fill applied to a single path:
State EXACTLY and COMPLETELY, click-by-click, command-by-command, tool-by-tool, step-by-step, the minimum steps necessary to replicate the behavior you are seeing.
Regarding a live effect like Warp:
It is normal behavior for the Effect to not "rotate" with the object, because you are rotating the object to which the live effect is applied. The live effect is automatically re-applied after every edit you make to the object. That's what the "live" nature of "live effects" is all about; it gets re-applied automatically on-the-fly as you edit the original object. The fact that live effects do not "rotate with the object" can be used to great advantage.
One way to cause the effect to "rotate with the object" is to store the object as a Symbol. Then, when you rotate Instances of that Symbol, the reference geometry of the effect is rotated also.
JET -
I need to implement rotation on graphics objects in a project that does NOT used graphics2d. Changing the code so that it does not use Graphics but Graphics2D would take a really long time. Is there a way to cast from one type of object to the other or is there some fast way to convert the code?
I am not sure what you are asking for. Are you saying that the Graphics object that you have been using so far in your project is not an instance of Graphics2D, i.e., if your Graphics object is g then
g instanceof Graphics2D evaluates to false?
I don't even know how to get an such an instance, so in that case I may not be able to help you. All Graphics objects that I have encountered are instances of Graphics2D although references to this object may have been declared as Graphics. If that is also the case for your Graphics object, then all you need to do is to declare a new Graphics2D reference and set it to point to your Graphics object cast into Graphics2D (which is one line of code, which I showed you earlier). Then you could rename all usages of the old reference to the new reference (if you are using an IDE, then chances are that it will have refactoring support that will make this easy).
*Actually, you do not need to rename all usages, only those usages where you call a method that is not in Graphics.*
I don't think you need to convert any of you shapes. I don't understand what you mean by converting shapes to 2D shapes.
Edited by: James_Vagabond on Jan 3, 2008 9:12 AM
Maybe you are looking for
-
File in use error - copying from a faulty external hard drive
Hi, I have a 750GB Western Digital external hard drive, which contains two partitions - (1) HDBACKUP - a Time Machine backup of my laptop drive, and (2) MEDIA - pictures including an Aperture library, and videos. When I plug the drive in, only the ME
-
How do I save PSD files created in windows so MAC users can open and work
I have been designing photoshop files for sale to photographers online and all of my work has been created in a windows 7 system. I had a photographer contact me saying that the PSD was trouble to open and that the fonts would not work on his MAC com
-
I can no longer access any BBC websites
I have my homepage set as the bbc website for many years - since yesterday I have been unable to connect to any of the bbc websites - I am having no problems accessing any other sites just the BBC for some strange reason
-
Hi, I currently subscribe to the Photographers Package for $9.99/month, which I'm more than happy with. However, now I also want to subscribe to the Premiere Pro app. Can I just add the Premiere Pro single app subscription to my current plan, there
-
Print priview and spool output are different
Hi Friends, i am facing a problem......for a output type (script realted) when i am giving print priview for per a PO .. in this priview 2 tax values are showing right. But when i am generating SPOOL in this that 2 tax values are Showing WRONG.. why