APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

How do i set a rotation axis for a 3d cylinder? post and replies

Return to the How do i set a rotation axis for a 3d cylinder? thread
Login to post to this thread

I am trying to port a file from old EJS to new EJSS
Leonardo Cricco
1 Posts

So I am trying to port this file which depicts a 3d robot arm and shows it can move from point A to point B. I am having trouble with the model. I cannot find the way to set the axis option that exists in old EJS in a 3d cylinder.

Here are both files so far. Any help would be great!

Attached File: Manipulador_Elbow_v2_OldEJS.zip


Replies to I am trying to port a file from old EJS to new EJSS

Re: I am trying to port a file from old EJS to new EJSS -
Ben David
1 Posts

To set the rotation axis for a 3D cylinder in your robotic arm model, follow these steps:
Axes Understanding:
Cylinders can rotate around the X, Y, or Z axis. Define which axis fits your robot's movement.
EJS Rotation:
In EJS, set the rotation axis in the cylinder's properties. Look for options like Transformation Matrix or Orientation. You might need to define the axis as a vector (e.g., [1, 0, 0] for X-axis).
Script Rotation:
Use commands like rotateX(), rotateY(), or rotateZ() to rotate the cylinder programmatically. snow rider
Check Import Settings:
If importing from an old file, verify the axis configurations were properly transferred.



Re: I am trying to port a file from old EJS to new EJSS -
lookang Avatar
lookang
245 Posts

I managed to fix your file by removing some illegal characters that were causing issues. After cleaning up those sections, the file runs smoothly now. For converting EJS to EJSS, you can follow the step-by-step guide available at this link: https://sg.iwant2study.org/ospsg/index.php/translations/359-re-create-or-convert-ejs-to-ejss   Re-create or convert EJS to EJSS. This guide walks you through the process, allowing you to run the EJSS extension in webEJS to generate the latest _source.json file.

 

 

 below is the error log in EJS 5.33

 

File successfully read Manipulador_Elbow_v2.xml Sorry! The simulation produced a run-time error. error =1 Generating simulation file Manipulador_Elbow_v2... C:\EJS\workspace\output\Manipulador_Elbow_v2_OldEJS\Manipulador_Elbow_v2_pkg\Manipulador_Elbow_v2.java:1047: error: illegal character: '\u00bf' public void _method_for_Par￯﾿ᄑmetros_Trayectoria_action () { ^ C:\EJS\workspace\output\Manipulador_Elbow_v2_OldEJS\Manipulador_Elbow_v2_pkg\Manipulador_Elbow_v2.java:1047: error: illegal character: '\u00bd' public void _method_for_Par￯﾿ᄑmetros_Trayectoria_action () { ^ C:\EJS\workspace\output\Manipulador_Elbow_v2_OldEJS\Manipulador_Elbow_v2_pkg\Manipulador_Elbow_v2.java:1047: error: invalid method declaration; return type required public void _method_for_Par￯﾿ᄑmetros_Trayectoria_action () { ^ C:\EJS\workspace\output\Manipulador_Elbow_v2_OldEJS\Manipulador_Elbow_v2_pkg\Manipulador_Elbow_v2View.java:86: error: illegal character: '\u00bf' public javax.swing.JButton Par￯﾿ᄑmetros_Trayectoria; ^ C:\EJS\workspace\output\Manipulador_Elbow_v2_OldEJS\Manipulador_Elbow_v2_pkg\Manipulador_Elbow_v2View.java:86: error: illegal character: '\u00bd' public javax.swing.JButton Par￯﾿ᄑmetros_Trayectoria; ^ C:\EJS\workspace\output\Manipulador_Elbow_v2_OldEJS\Manipulador_Elbow_v2_pkg\Manipulador_Elbow_v2View.java:86: error: expected public javax.swing.JButton Par￯﾿ᄑmetros_Trayectoria; ^ ^ 9 errors Compilation produced an error! File saved successfully Manipulador_Elbow_v2_OldEJS/Manipulador_Elbow_v2.xml Generating simulation file Manipulador_Elbow_v2... Compilation successful Congratulations! The simulation was generated successfully. Trying to run simulation Manipulador_Elbow_v2... Congratulations! The simulation seems to run alright. File saved successfully Manipulador_Elbow_v2_OldEJS/Manipulador_Elbow_v2.ejs Generating simulation file Manipulador_Elbow_v2... Compilation successful Congratulations! The simulation was generated successfully. Trying to run simulation Manipulador_Elbow_v2... Compressing file... ejs_model_Manipulador_Elbow_v2.jar Compressed file created successfully ejs_model_Manipulador_Elbow_v2.jar

Attached File: Manipulador_Elbow_v2.zip


OSP@SG blog
OSP@SG Digital Library


OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book