Skip to main content

Translation and Scaling at the same time

2 replies [Last post]
pranavgoyal
Offline
Joined: 2010-08-18
Points: 0

I am very new to j3d and got stuck at a place. Can someone tell me a way to do scaling and translation at the same time. I want to translate a cylinder in -ve y direction and while I am translating it down I want to scale it bigger and bigger in y direction. I think u got what I want. I want to make it's length bigger while translating. Please suggest me something how to do it.

Or any other way to show a cylinder being filled with fluid as time moves.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
lyfox
Offline
Joined: 2010-08-17
Points: 0

Do you mean something like this?
http://www.2shared.com/file/ADFXPtD6/CylinderGrow.html

Use Transform3D.mul() method. When you multiply 2 matrices, it means you apply those transforms sequentially.
A better way would be to move the pivot point and use only scaling... But well, nevermind. Many ways are possible.

Good luck.

Marcel nagm

its simple, Create a TransformGroup and add you BranchGroup there.
You can instance a Transform3d and set the scale and translation vector by
methods
like setScale() and setTranslationVector() at transform3d and then you can
set the transform3d at TransformGroup.
That is simple, any more question?

2010/8/19

> Do you mean something like this?
> http://www.2shared.com/file/ADFXPtD6/CylinderGrow.html
>
> Use Transform3D.mul() method. When you multiply 2 matrices, it means you
> apply those transforms sequentially.
> A better way would be to move the pivot point and use only scaling... But
> well, nevermind. Many ways are possible.
>
> Good luck.
> [Message sent by forum member 'lyfox']
>
> http://forums.java.net/jive/thread.jspa?messageID=480612
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
> For additional commands, e-mail: interest-help@java3d.dev.java.net
>
>

--
Atc. Marcel Nagm
"Rico é o homem que tem fé em si e em Deus"
[att1.html]