# NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

## Easy Java Simulations (2001- ) => Questions related to EJS => Topic started by: lookang on November 09, 2009, 09:54:12 am

 Title: How can i transform a 3D cylinder using 2 transformation with dynamic variables Post by: lookang on November 09, 2009, 09:54:12 am Hi Prof,How can i transform a 3D cylinder using Code:"z:"+cta andCode:y:90deach works on its own but i can't figure out how to add both.for example i tried but it doesn't workCode:"y:90d & "z:"+cta"my reference:http://www.um.es/fem/EjsWiki/Main/ElementsAboutTransformsi want a rotating cylinder with both transformation to achieve the look of a cylinder (http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=1293.0;attach=1453;image)attached in my source xml for(http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=1293.0;attach=1451;image) Title: Re: How can i transform a 3D cylinder using 2 transformation with dynamic variables Post by: Fu-Kwun Hwang on November 09, 2009, 05:04:54 pm If you want to do "z:"+cta then "y:90d", you should set the property to "z:"+cta+" & x:90d"If you want to do "y:90d" then "z:"+cta  you should set the property to "x:90d & z:"+ctaBecause cta is a variable so it need to be outside the string and added to property string with "+" operator. Title: Re: How can i transform a 3D cylinder using 2 transformation with dynamic variab Post by: lookang on November 09, 2009, 08:01:49 pm Fantastic tips. Thx a million!Will try laterfinally understood the logic is additive.using Code:"y:90d & x:"+ctato achieve the same effect! thx!