Resizing an object

View: New views
5 Messages — Rating Filter:   Alert me  

Resizing an object

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How do you resize an object like a Sphere?  I know there is probably some type of transform involved but I haven't been able to figure it out.  I'm new to Java3D and 3D in general so any help would be greatly appreciated.

Mike
[Message sent by forum member 'sacauskis' (sacauskis)]

http://forums.java.net/jive/thread.jspa?messageID=288513

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...


Re: Resizing an object

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Attach your Shape3D to a TransformGroup, then set a Transform3D instance.
Transform3D is the  object where you can perform several transforms as scale, move, rotate, etc.



See the Java3D Tutorials : http://java.sun.com/developer/onlineTraining/java3d/

Your scene graph will look like this:
[code]
TransformGroup ->Shape3D
     |
     |---> Transform3D
[/code]
[Message sent by forum member 'zesharp' (zesharp)]

http://forums.java.net/jive/thread.jspa?messageID=288553

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...


Re: Resizing an object

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

So do I just use the setScale method?  I've firgure the zoom, rotate and those, just haven't figured out the scale yet.
[Message sent by forum member 'sacauskis' (sacauskis)]

http://forums.java.net/jive/thread.jspa?messageID=288572

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...


Re: Resizing an object

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

[code]
public final void setScale(Vector3d scale)
[/code]

"scale" is a Vector where you set amount of scaling in x, y and z axis.

To uniform scale up by 100%,  do this:

[code]
Vector3d scale = new Vector3d();
scale.x = 2.0d;
scale.y = 2.0d;
scale.z = 2.0d;

myTransform3D.setScale(scale)

myTransformGroup.setTransform(myTransform3D);
[/code]

You can set diferent values to X, Y and Z to have a non-uniform scale efect.
[Message sent by forum member 'zesharp' (zesharp)]

http://forums.java.net/jive/thread.jspa?messageID=288682

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...


Re: Resizing an object

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks appreciate the help.
[Message sent by forum member 'sacauskis' (sacauskis)]

http://forums.java.net/jive/thread.jspa?messageID=288754

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...

LightInTheBox - Buy quality products at wholesale price