 |
Using 3D interactive shapes in HView3d
Source code name: "canvas3D_hview3d.py"
Programming language: Python
Topic: Graphics/3D
DMelt Version 1. Last modified: 01/08/2016. License: Pro
https://datamelt.org/code/cache/canvas3D_hview3d_2738.py
To run this script using the DMelt IDE,
copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.
from java.awt import Color
from jhplot import HView3D
from jhplot.v3d import Cube,Sphere,Cone,Cylinder
c1 = HView3D("Canvas",400,400)
c1.visible(1)
c1.setGTitle("3D objects in HView3D")
o= Cube(c1.getModel(),40)
o.setRot(45,45,45)
c1.draw(o)
o = Sphere(c1.getModel(), 30.0, 80, 80)
o.setTrans(40,-20,10)
c1.draw(o);
o = Cone(c1.getModel(), 30, 100, 50)
o.setTrans(-20, 30, 0)
o.setColor(Color.red)
c1.draw(o);
o = Cylinder(c1.getModel(), 40, 100, 2)
o.setTrans(-1, 0, 0)
o.setRot(0, 60, 0)
o.setColor(Color.yellow)
c1.draw(o)
c1.update()
You see the box below because you did not login.