Resizing 3d objects

Hello! I'm new at java3d and i'm researching for my university project. I have the following question: how can i resize a object imported from a .obj file? There is any way to do that? Suppose i've a .obj that i want to load to my project but i need to resize it to be with the same width but a different weight.
I've the code above:
Transform3D objLocation = new Transform3D();
objLocation.set(p.scale, new Vector3d(p.posx, p.posy, p.posz));
//returns a scene with the object i want
Scene s = ObjLoad();
TransformGroup newScene = new TransformGroup();
newScene.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
newScene.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
newScene.setTransform(objLocation);
newScene.addChild(s.getSceneGroup());
objSpin.addChild(newScene);
The solution i figured out makes possible to place the object where i want and scale it, but it doesn't work because i want to redimensionate the object and not to scale it...
I would appreciate any help!
tks in advance
ps: sorry about the poor english, hope you understand it
Bruno
Portugal

Java3D uses a 4x4 matrix for these operations. Scale and rotate happen in the upper-left 3x3 matrix.
This matrix doesn't affect translation at all.
I think the 3x3 matrix that do what you want is the following :
xscale 0 0
0 yscale 0
0 0 zscale
so you just have to create your TransformGroup using this Transform3D.
Matrix3d scalematrix = new Matrix3d(xscale, 0, 0, 0, yscale, 0, 0, 0, zscale);
Vector3d translationvector = new Vector3d(xtranslation, ytranslation, ztranslation);
Transform3D t3d = new Transform3D(scalematrix, translationvector, 0d);hope this will help !
c ya
GnG

Similar Messages

  • [CS2] [JS] Resize anchored object...

    Good morning:
    I need help figuring out how to resize different objects that are anchored in text. They do have a script label on them.
    For example I have an inline text box with the script label "gadget" that needs to be resized from 1 inch to 2 inches.
    Is there away to do this by way of a script?
    Thanks in advance!
    Theresa

    Hi Teresa,
    This is a very basic example: it adds 1 inch to the width and height of the inline text frame with "gadget" label (I assume that it may occur only once in each story and measurements are set to inches). I wrote this on CS3 — don't have CS2 any more.
    var myDoc = app.activeDocument;
    var myStories = myDoc.stories;
    for (i = 0; i < myStories.length; i++) {
        var myTextFrame = myStories[i].textFrames.item("gadget");
            if (myTextFrame != null) {
            var myGb = myTextFrame.geometricBounds;
            var myNewGb = [myGb[0], myGb[1], myGb[2]+1, myGb[3]+1];
            myTextFrame.geometricBounds = myNewGb;
    Kasyan

  • Resizing selected objects

    Ok, so I am trying to write a script that resizes an object that is selected. I have two objects selected, the one on top is a group item, the one below it is a rectangle. I am trying to resize the rectangle to the size of the group item on top of it with a little margin around it. Here is what I have so far.
    var design = app.activeDocument.selection[0];
         var top=design.visibleBounds[1]+5*2; 
         var left=design.visibleBounds[0]-5*2; 
         var width=design.visibleBounds[2]-design.visibleBounds[0]+10*2;
         var height=design.visibleBounds[1]-design.visibleBounds[3]+10*2;
    var background = app.activeDocument.selection[1];
    background.position = (top, left, width, height);
    The problem is the last line there. I'm not sure how to manipulate the position/size of the selected object or if it is even possible I have searched for it and haven not found an answer. Thanks in advance!

    position property expects an Array, with x and y values, in that order. As for the width and height properties, use them in separate statements
    background.position = [left, top];
    background.width = width;
    background.height = height;

  • Smart Guides, Constrain Proportions and Resizing an Object.

    When I have Smart Guides on and I'm trying to resize an object while holding shift (to constrain) Indesign seems to ignore the shift key. Usually when there's other objects in close proximity, or just closely aligned, vertically or horizontally. The image I posted is a good example. Trying to resize the bracket object while near all those other objects results in a lot of skipping around, and constrain not working. You can see in the image the outline is not constrained, even though I'm holding the shift key. It just wants to jump to those Smart Guides regardless of what I'm trying to tell it to do.
    This isn't much of an issue, but basically I'm wondering if this is a bug, or if the Smart Guides, just take priority. It's bit annoying turning smart guides on and off constantly to accomodate this odd behavior. Does anyone have any insight on this?

    Hi,
    I'm on a Mac Snow Leopard/CS5, and there actually is an update I haven't installed yet. I'm on 7.0.3, so I'll try that out.
    If it is a bug it's certainly not the end of the world, but I was curious if anyone else had been dealing with it as well. I love the Smart Guides, except for that.

  • Resizing grouped objects keynote

    In keynote I would like to be able to resize grouped objects without maintaining proportionality - is this possible?
    The "Constrain Proportions" button is greyed out for grouped objects for me.
    I'm using version 6.2

    Why can't I resize grouped objects in the new Keynote without constraining proportions
    The only people who can give an informed answer are the Apple engineers, however they don't post in the user to user community.
    Keynote 5.3 certainly could do this, but the latest version of Keynote is a completely separate application with different tools and features and file format.
    You can let Apple know of your concern by using:     Apple Feedback

  • Resizing drawing objects defies pixel snapping

    This happens mostly with drawing objects, and to a lesser degree with shapes. When resizing drawing objects in Flash CS6 with pixel snapping turned on, one would expect the dimensions of the shape to snap to even pixel numbers. For the most part it does, but too frequently the position and size values begin to drift into fractions of pixels.
    If you create a rectangle as a drawing object, no stroke, it will snap to pixels properly. Drag it around and it always lands on whole pixel values. Now try resizing it using the free transform tool, or even by clicking and dragging the position and size values in the properties panel. Width and height values will mostly stick to whole pixels, but too often it will slip into fractions of pixels, bizarrely offsetting the x and y values as well. If you resize a drawing object and this error occurs, it does not help to try and move it to snap it back onto whole pixels, because it will snap to whatever fraction of a pixel it's currently stuck in, thereby forcing the user to manually edit the object's x and y coordinates.
    This is a problem in my workflow as I'm constantly having to keep an eye on the properties panel and manually editing the numbers when shapes stray into 2.85 pixels or some such when I want it at 3. I find myself frequently just entering the numbers I want, which defeats the purpose of pixel snapping in the first place.

    This happens mostly with drawing objects, and to a lesser degree with shapes. When resizing drawing objects in Flash CS6 with pixel snapping turned on, one would expect the dimensions of the shape to snap to even pixel numbers. For the most part it does, but too frequently the position and size values begin to drift into fractions of pixels.
    If you create a rectangle as a drawing object, no stroke, it will snap to pixels properly. Drag it around and it always lands on whole pixel values. Now try resizing it using the free transform tool, or even by clicking and dragging the position and size values in the properties panel. Width and height values will mostly stick to whole pixels, but too often it will slip into fractions of pixels, bizarrely offsetting the x and y values as well. If you resize a drawing object and this error occurs, it does not help to try and move it to snap it back onto whole pixels, because it will snap to whatever fraction of a pixel it's currently stuck in, thereby forcing the user to manually edit the object's x and y coordinates.
    This is a problem in my workflow as I'm constantly having to keep an eye on the properties panel and manually editing the numbers when shapes stray into 2.85 pixels or some such when I want it at 3. I find myself frequently just entering the numbers I want, which defeats the purpose of pixel snapping in the first place.

  • Not able to resize my objects in Nested iview

    Dear all,
    This is how I created my dashboard.
    Model -> iview -> Layers(tabs) -> Each layer has various forms, queries and charts.
    Now I have changed it to
    Model -> iview -> Layers(tabs) -> Nested iview-> Each Nested iview has various forms, queries and charts.
    Can you suggest the best approach in terms of flixibility and performance.
    When I introduced a Nested Iview I amd not able to resize my objects ( table, chart, forms etc). I am not sure why. When I go into nested iview and go to Layout tab I see a blank page and can see nothing.
    Could anyone help me please.
    Also I would appreciate if anyone can  suggest me the best practice for creating a dashboard.
    Thanks,
    KK

    Hi,
    Yes you are correct.
    to make good Layout for Nestedview contents drilldown to the Nestedview and then go to its layout there you can make the Chages to layout.
    Regards,
    Govindu

  • Problem resizing certain objects

    I converted a project from Captivate 1 to 2. I noticed that I
    am having trouble resizing certain objects. For example, by
    clicking on a highlight box, I expected the sizing handles to show
    up on the object so I could resize it. The handles weren't there. I
    ended up having to delete the object and create a new one.
    Constrain Proportions is "unchecked." By the way, this doesn't
    happen everytime. Sometimes it works; sometimes it doesn't. Is
    there a patch for Captivate 2 I could install?

    Hi Jerilyn
    Indeed a patch does exist for Captivate 2. However, I'm very
    doubtful it will have any effect on what you reported.
    Unfortunately, we see many such reports here in the forums with odd
    behavior related to projects that were "converted" from version 1.
    If you are interested,
    click here to see the
    Technical Note regarding the hot fix.
    Cheers... Rick

  • Why does the corner widget go away if I resize an object?

    In Illustrator CC (V 17.1.0 (64-bit) running Windows 7 Home Premium, I find that if I have resized an object, I no longer get the Corners option or widget when I switch to the Direct Select Tool. For discussion, assume we are talking about a box with square corners. When a new box is drawn of any size, all corner functions work perfectly but if the box is resized in any way, I no longer get the widget and the Corners menu item is no longer present.
    Any suggestions?

    Maybe you should start closing message tabs after you read them. If you have so many open that your inbox gets pushed off the screen you obviously just keep opening tabs without closing old ones.
    To get out of your situation now right click one tab and select Close Other Tabs. Then use the x on the remaining tab to click we it.

  • Is it possible to move/resize individual objects in Compound Clipping Path in Illustrator?

    Hi,
    I have created a Compound Clipping Path in Adobe Illustrator, and wonder if there is a way of moving/resizing individual objects in this path that create the mask? At the moment when I try to change just one object it changes them all.
    Essentially I am try to make fine adjustments to the mask.
    Thanks in advance for any help,
    Nick

    Adobe updated masks in CS4, which has made to editing inidividual contents within masks more difficult, especially more complex masks (eg: nested)
    When you select a mask now you select the mask and the contents. 5 ways to help you select the elements within the mask:
    To get into the contents to edit them use the "Edit Contents" button (the 2nd one in the top left).
    Flip down your layers palette triangles, to try and make selections there
    Individually select items with the hollow arrow tool or group select tool, and hide them, then unhide to have the sum of the elements selected.
    Save back to CS3 and work in CS3 
    Isolation Mode (though that mode is preferred disabled by many users)
    Be careful as if you ever release a mask, this can entirely mess up your layeringorder on occasion, and undo won't help. Save before releasing a mask, sometimes you can undo, sometimes undo will not be abel to reconstruct you layer order.

  • Illustrator thinks I want to resize an object...

    Hi, so this is an issue that really annoys me and I'm not sure if there's a solution for it and/or if someone has complained about it.
    Basically, if I make a small shape, something about 50x80px and I try to grab the shape to move it to a different location, illustrator just assumes that I want to resize the object and acts as if I grabbed the corner points. I specifically try to click away form the resizing points and it still does it. Its really annoying because the only way I can grab the object is by zooming in and making sure the cursor is now a lot smaller than the shape to move the object. The problem with doing this is that by zooming it forces me to scroll with the object to the place I want to be.
    When this happens, my cursor doesn't change to the 'resizing' cursor... the one with the 2 small arrows pointing opposite directions. It stays as the regular cursor.
    I am using the Illustrator CC updated to the latest as of this date.

    Vhalor,
    I believe it is safest to hold Alt/Option when you use the Direct Selection Tool, to avoid the danger of dragging only some Anchor Points.
    I wonder whether it is time for the list.
    The following is a general list of things you may try when the issue is not in a specific file, and when it is not caused by issues with opening a file from external media, see below. You may have tried/done some of them already; 1) and 2) are the easy ones for temporary strangenesses, and 3) and 4) are specifically aimed at possibly corrupt preferences); 5) is a list in itself, and 6) is the last resort.
    If possible/applicable, you should save current artwork first, of course.
    1) Close down Illy and open again;
    2) Restart the computer (you may do that up to at least 5 times);
    3) Close down Illy and press Ctrl+Alt+Shift/Cmd+Option+Shift during startup (easy but irreversible);
    4) Move the folder (follow the link with that name) with Illy closed (more tedious but also more thorough and reversible);
    5) Look through and try out the relevant among the Other options (follow the link with that name, Item 7) is a list of usual suspects among other applications that may disturb and confuse Illy, Item 15) applies to CC, CS6, and maybe CS5);
    Even more seriously, you may:
    6) Uninstall (ticking the box to delete the preferences), run the Cleaner Tool (if you have CS3/CS4/CS5/CS6/CC), and reinstall.
    http://www.adobe.com/support/contact/cscleanertool.html

  • Resize an object (image) doesn't work?

    Hi
    I'm trying to resize an image, but nothing happens. I'm following the instructions in the Help page.
    Description:
    - Click the Select Object tool.
    - Selection handles appear when the pointer is over the image (so the image is not locked).
    - Click the image. A thicker selection border appears.
    - Drag a handle of the object.
    - The selection is changing size, but nothing happens with the image.
    Same thing with Shift-drag the handle (to retain the original aspect ratio), nothing happens with the image.
    What is wrong?
    Note:
    the image is also a link. Could it be that the selection that appears is for the link, and not for the image? If so, how can I select the image instead?
    I have tried to remove the image link (Select Object tool, right click the image, Properties, remove link), but the image could still not be resized.
    Software:
    Adobe Acrobat X Standard
    Windows 7 Pro

    I don't think there is an "object touchup tool".
    Adobes help for Adobe Acrobat X Standard says:
    Resize an object
    Click the object with the Select Object tool , or the tool used to create the object.
    Drag a handle of the object. Shift-drag the handle to retain the original aspect ratio.
    Link:
    http://help.adobe.com/en_US/acrobat/standard/using/WS58a04a822e3e50102bd615109794195ff-7c7 4.w.html
    But only the selection border is being resized, not the image.
    I'm beginning to believe there is a bug in the resizing function.

  • Resize an Object via javascript

    Resize an Object via javascript
    How do I...
    I want to select an object in my document, onscreen, (an image, or text) then run a script that will discern the object selected, and show a dialog box that will allow me to input a sizing percentage for that object (with anchor corner/center)(Press enter and object resizes).

    No they don't.
    Acrobat may be bundled with Creative Suite collections but the APIs has nothing in common other than the use of JavaScript. CS apps use the ExtendScript system, Acrobat has its own internal API and an SDK for inter-application control.
    PDF is an end-destination format - the page content is not designed to be edited, so while there are tools in the user interface to allow touchups and corrections to page objects those features are not available for automation. The JavaScript engine does not have access to the low-level document structure, it can only see markup (comments and form elements) and a limited range of document properties.
    bdmasha wrote:
    They are all part of a suite of tools that share a common access to internal api's via scripting/programming languages.
    InDesign is not Photoshop is not Illustrator, but they have much in common when accessing their api's that Acrobat does not allow--and Acrobat is part of that Adobe suite.
    Thanks again.

  • ID CS4: Is there a way to resize multiple objects at one time?

    InDesign CS4: I have a group of object frames that I need to resize (I don't care about resizing the content, I know how to do that) and I'm wondering if there's a way to resize them all at once to a specific size. If I group them and resize them it only gives me the group height and width, I want them each to be a specific measurement.
    Any suggestions or know plug-ins to help?

    If you don't want to use data merge or xml, you can also place multiple images in one action.

  • How to resize an object in an Outlook email on a Mac?

    When I bring an object, say a screenshot of a web site, inside an Outlook email on a Retina display Mac, the image is typically hige and cannot be resized. In Outlook for Windoes, you can just resize it any size you want by clicking on a corner and resizing. In Mac Mail, there is an option to resize but with only 3 predefined sizes (small, medium, and large if my memory serves me well). Can this resizing be done in Outlok mail and I just missed it? If not can Apple work with Microsoft to get them to put this basic feature in? And do a better job with Apple Mail on this?
    I am the guinea pig for my company to see if we should not switch everyone to Mac. I like Mac a lot, but there are a few basic features like this one that may make it impossible. Another one is the seemingly lack of ability to turn on auto formating of hyperlinks in Outlook or Aple Mail. When I ahve talked to an Apple Geniws on these 2 issues, they typically tell me they don;t know much about Outlook and they want to focus on Mac Mail. The probem is my entire company, like many, is using Outlook exchange and is not going to change that anytime soon. Is there a solution to this resizing issue?

    This may not be the correct design, but I had success doing the following:
    1. Create an Stateless EJB that does a task, i.e. update a database table.
    2. Create a subclass of java.util.TimerTask to call the EJB methods.
    3. Kick off the TimerTask from a servlet.init method.
    Seems to work pretty well to do scheduled tasks, such as refreshing lookup tables. I would imagine the same could be done with an MBean, but I haven't had time to fully understand JMX yet. (It's on the list).
    As for event driven procedures, that can be done through a servlet interface.
    You may also wish to review a scheduler here: http://www.part.net/quartz.html. Note, I have NOT even looked at it yet, so I have no clue if it's any good. But, it is on my list of tools to evaluate (that's a long list) someday when my head's above water. Have a look, and caveat emptor.
    Hope this helps,
    Perry Tew

Maybe you are looking for