# Transformations

**843799**Mar 22, 2010 12:12 PM

Hello,

I am trying to develop a graphical tool that can draw lines, cubes, spheres, triangles and polygon, The first three can be drawn by now. The triangle and polygon requires the code.

I would like someone to give me a start with the transformation. The transformation is expected to take place when respective Jmenu options are selected. Can a sample code for a single transformation (let it be shearing along X-axis be provided). I can do the remaining in similar fashion. Also if possible tell me how to pick an individual object and conduct the transformations on it in the above said mode.

The full code cannot be added due to the restriction of 7500. So I am adding the link to the same question that I asked in another forum.

[http://forums.java.net/jive/thread.jspa?threadID=77010&tstart=0|http://forums.java.net/jive/thread.jspa?threadID=77010&tstart=0]

What I require is this.

I am trying to develop a graphical tool that can draw lines, cubes, spheres, triangles and polygon, The first three can be drawn by now. The triangle and polygon requires the code.

I would like someone to give me a start with the transformation. The transformation is expected to take place when respective Jmenu options are selected. Can a sample code for a single transformation (let it be shearing along X-axis be provided). I can do the remaining in similar fashion. Also if possible tell me how to pick an individual object and conduct the transformations on it in the above said mode.

The full code cannot be added due to the restriction of 7500. So I am adding the link to the same question that I asked in another forum.

[http://forums.java.net/jive/thread.jspa?threadID=77010&tstart=0|http://forums.java.net/jive/thread.jspa?threadID=77010&tstart=0]

What I require is this.

```
menu = new JMenu("View");
menu.add(createMenuItem("View", "Triangle", this));
menu.add(createMenuItem("View", "Polygon", this));
menuBar.add(menu);
//public BranchGroup triangle() {
/*Require code for Triangle /*
//}
//public BranchGroup polygon() {
/*require code for Polygon*/
//}
public void shearx()
{
/*require sample code*/
}
else if (command.equals("Triangle"))
{
//triangle();
}
else if (command.equals("Polygon"))
{
//polygon();
}
}
else if (menu.equals("Shear")) {
if (command.equals("X-axis")) {
//shearx();
}
}
}
}
```

Thank you - 65 Views
- Tags: none (add)