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

Deleted Post
Leonardo Cricco
1 Posts

Post removed on October 2, 2025 at 11:38 PM EST.

Attached File: Manipulador_Elbow_v2_OldEJS.zip


Replies to Deleted Post

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
244 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


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

To set the axis option for a 3D cylinder in your robot arm model, you typically need to adjust the properties of the cylinder in your code. In EJS (Easy Java Simulation), you can define the axis by specifying the rotation parameters.Game Snow Rider 3D

Here's a quick guideline:

Locate the Cylinder Definition: Find where the cylinder is defined in your code.
Set the Axis: Use the setAxis method or equivalent property to define the rotation axis. For example:
Copy
cylinder.setAxis([1, 0, 0]); // For rotation around the x-axis
If you share specific code snippets or details about the environment you're using, I can provide more tailored assistance!



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

Have you tried using the newer 3D elements or checking the documentation for axis settings in the latest EJS version? It might handle 3D cylinders differently slope game now. Share the files -- maybe someone can spot the issue.



Re: I am trying to port a file from old EJS to new EJSS -
Francisco Esquembre
238 Posts

Hi,
I personally think it best to use the rotation elements included in the 3D palette. These are easier to understand how the work...
Paco



Re: How do i set a rotation axis for a 3d cylinder? -
Leonardo Morrison
1 Posts

Most 3D software or frameworks let you define the axis as a line or a directional vector, often with an origin point. For example, in Blender, you can rotate around the X, Y, or Z axis, or a custom axis using the Transform panel.



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