chrono icon indicating copy to clipboard operation
chrono copied to clipboard

issue with irrlicht - black screen

Open ZhiquanW opened this issue 6 years ago • 3 comments

When i try to run codes with IrrApp in while loop like:


while True:
    system = chrono.ChSystemNSC()
    # set simulation system
    ....
    irr_app = irr.ChIrrApp(system, 'irr', irr.dimension2du(800, 600))
    ...
    while irr_app.GetDevice().run():
        irr_app.BeginScene()
        irr_app.DrawAll()
        system.DoStepDynamics(0.01)
        irr_app.EndScene()
        if system.GetChTime() > 10:
            irr_app.GetDevice().closeDevice()
            break

The rendering is correct at the first time(the first loop), and turn black in the following loops.

ZhiquanW avatar Oct 23 '19 03:10 ZhiquanW

I'm not sure what sim_env is here. Are you sure you didn't mean to use if system.GetChTime() > 10:?

rserban avatar Oct 23 '19 04:10 rserban

Sorry , i forget to change the name to system:ChSystemNSC()

ZhiquanW avatar Oct 23 '19 14:10 ZhiquanW

What i want to do is restart the simulation after 10 seconds.

ZhiquanW avatar Oct 23 '19 14:10 ZhiquanW