def create_application(): # --------------------------------------------------------------------- # # Create an Irrlicht application to visualize the system # myapplication = chronoirr.ChIrrApp(my_system) myapplication.AddTypicalSky('../bin/data/skybox/') myapplication.AddTypicalCamera(chronoirr.vector3df(0.5,0.5,1.0)) myapplication.AddLightWithShadow(chronoirr.vector3df(2,4,2), # point chronoirr.vector3df(0,0,0), # aimpoint 9, # radius (power) 1,9, # near, far 30) # angle of FOV # ==IMPORTANT!== Use this function for adding a ChIrrNodeAsset to all items # in the system. These ChIrrNodeAsset assets are 'proxies' to the Irrlicht meshes. # If you need a finer control on which item really needs a visualization proxy in # Irrlicht, just use application.AssetBind(myitem); on a per-item basis. myapplication.AssetBindAll(); # ==IMPORTANT!== Use this function for 'converting' into Irrlicht meshes the assets # that you added to the bodies into 3D shapes, they can be visualized by Irrlicht! myapplication.AssetUpdateAll(); # If you want to show shadows because you used "AddLightWithShadow()' # you must remember this: myapplication.AddShadowAll(); myapplication.SetStepManage(True) myapplication.SetTimestep(0.001) myapplication.SetTryRealtime(True) return myapplication
# ..create the function for imposed y vertical motion, etc. mfunZ = chrono.ChFunction_Sine(0, 1.5, 0.12) # phase, frequency, amplitude mfunZ.thisown = 0 # because the link will take care of deletion! link_shaker.SetMotion_Z(mfunZ) # Note that you could use other types of ChFunction_ objects, or create # your custom function by class inheritance (see demo_python.py), or also # set a function for table rotation , etc. # --------------------------------------------------------------------- # # Create an Irrlicht application to visualize the system # myapplication = chronoirr.ChIrrApp(my_system) myapplication.AddTypicalSky('../data/skybox/') myapplication.AddTypicalCamera(chronoirr.vector3df(0.5, 0.5, 1.0)) myapplication.AddLightWithShadow( chronoirr.vector3df(2, 4, 2), # point chronoirr.vector3df(0, 0, 0), # aimpoint 9, # radius (power) 1, 9, # near, far 30) # angle of FOV # ==IMPORTANT!== Use this function for adding a ChIrrNodeAsset to all items # in the system. These ChIrrNodeAsset assets are 'proxies' to the Irrlicht meshes. # If you need a finer control on which item really needs a visualization proxy in # Irrlicht, just use application.AssetBind(myitem); on a per-item basis.
# Note that you could use other types of ChFunction_ objects, or create # your custom function by class inheritance (see demo_python.py), or also # set a function for table rotation , etc. # --------------------------------------------------------------------- # # Create an Irrlicht application to visualize the system # myapplication = chronoirr.ChIrrApp(my_system) myapplication.AddTypicalSky('../data/skybox/') myapplication.AddTypicalCamera(chronoirr.vector3df(0.5,0.5,1.0)) myapplication.AddLightWithShadow(chronoirr.vector3df(2,4,2), # point chronoirr.vector3df(0,0,0), # aimpoint 9, # radius (power) 1,9, # near, far 30) # angle of FOV # ==IMPORTANT!== Use this function for adding a ChIrrNodeAsset to all items # in the system. These ChIrrNodeAsset assets are 'proxies' to the Irrlicht meshes. # If you need a finer control on which item really needs a visualization proxy in # Irrlicht, just use application.AssetBind(myitem); on a per-item basis. myapplication.AssetBindAll(); # ==IMPORTANT!== Use this function for 'converting' into Irrlicht meshes the assets # that you added to the bodies into 3D shapes, they can be visualized by Irrlicht!
mframe = chrono.ChFrameD(chrono.ChVectorD(0.1,0.5,0)) # initialize the constraint telling which part must be connected, and where: mlink.Initialize(mbody1,mbody2, mframe) mysystem.Add(mlink) # --------------------------------------------------------------------- # # Create an Irrlicht application to visualize the system # myapplication = chronoirr.ChIrrApp(mysystem) myapplication.AddTypicalSky('../data/skybox/') myapplication.AddTypicalCamera(chronoirr.vector3df(0.6,0.6,0.8)) myapplication.AddTypicalLights() # ==IMPORTANT!== Use this function for adding a ChIrrNodeAsset to all items # in the system. These ChIrrNodeAsset assets are 'proxies' to the Irrlicht meshes. # If you need a finer control on which item really needs a visualization proxy in # Irrlicht, just use application.AssetBind(myitem); on a per-item basis. myapplication.AssetBindAll(); # ==IMPORTANT!== Use this function for 'converting' into Irrlicht meshes the assets # that you added to the bodies into 3D shapes, they can be visualized by Irrlicht! myapplication.AssetUpdateAll();
mysystem.Add(mbody1) mboxasset = chrono.ChBoxShapeShared() mboxasset.GetBoxGeometry().Size = chrono.ChVectorD(0.2, 0.5, 0.1) mbody1.AddAsset(mboxasset) mboxtexture = chrono.ChTextureShared() mboxtexture.SetTextureFilename('../data/concrete.jpg') mbody1.GetAssets().push_back(mboxtexture) # --------------------------------------------------------------------- # # Create an Irrlicht application to visualize the system # myapplication = chronoirr.ChIrrApp(mysystem) myapplication.AddTypicalSky('../data/skybox/') myapplication.AddTypicalCamera(chronoirr.vector3df(0.6, 0.6, 0.8)) myapplication.AddTypicalLights() # ==IMPORTANT!== Use this function for adding a ChIrrNodeAsset to all items # in the system. These ChIrrNodeAsset assets are 'proxies' to the Irrlicht meshes. # If you need a finer control on which item really needs a visualization proxy in # Irrlicht, just use application.AssetBind(myitem); on a per-item basis. myapplication.AssetBindAll() # ==IMPORTANT!== Use this function for 'converting' into Irrlicht meshes the assets # that you added to the bodies into 3D shapes, they can be visualized by Irrlicht!