DawSegments not showing line

35 views
Skip to first unread message

Meninstick

unread,
Oct 5, 2023, 11:51:21 AM10/5/23
to ProjectChrono

Hi,

I'm trying to visualize certain points on a tracked vehicle at runtime. DrawSegment is not working for me, maybe I've misunderstood something. Ive tried at various locations but nothing shows up.

I would be really thankful for any guidance.

auto vis = chrono_types::make_shared<ChTrackedVehicleVisualSystemIrrlicht>();

.

.

.

.

 while (vis->Run()) {

 //irrlicht::tools::drawSegment(std::static_pointer_cast<irrlicht::ChVisualSystemIrrlicht>(vis).get(), vehicle.GetChassis()->GetDriverPos(), vehicle.GetChassis()->GetDriverPos() + ChVector<>(0, 0, 10));


irrlicht::tools::drawSegment(vis.get(), vehicle.GetChassis()->GetDriverPos(), vehicle.GetChassis()->GetDriverPos() + ChVector<>(0, 0, 10));

Radu Serban

unread,
Oct 5, 2023, 12:43:02 PM10/5/23
to ProjectChrono

Hi Meninstick,

 

I cannot reproduce this issue. Are you sure you are making the call to drawSegment() *between* the calls to BeginScene() and EndScene()?

Also, use the 2nd form you have below. Casting to ChVisualSystemIrrlicht will likely not work (because of some multiple inheritance for the vehicle visualization systems).

 

--Radu

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/02641ab2-2943-4dec-893e-8f3d1c0113b3n%40googlegroups.com.

Message has been deleted

Meninstick

unread,
Oct 6, 2023, 3:56:23 AM10/6/23
to ProjectChrono
Hi,
I didn't make the call between BeginScene and EndScene, it is working now but only when I make the call AFTER vis->Render().

Thank you very much for a quick and helpful answer!

Radu Serban

unread,
Oct 6, 2023, 3:57:52 AM10/6/23
to ProjectChrono

I have no problem if I add the following 2 lines:

            auto vis_irr = std::static_pointer_cast<ChTrackedVehicleVisualSystemIrrlicht>(vis);

            irrlicht::tools::drawSegment(vis_irr.get(), vehicle.GetChassis()->GetDriverPos(),

                                         vehicle.GetChassis()->GetDriverPos() + ChVector<>(0, 0, 10));

after the call to vis->Render() and before the call to vis->EndScene() in demo_VEH_M113.cpp

 

Could you please try that?  If that doesn’t work for you, please provide more information (Chrono version, Irrlicht version, OS, compiler, etc)

 

--Radu

 

From: 'Meninstick' via ProjectChrono <projec...@googlegroups.com>
Sent: Friday, October 6, 2023 9:46 AM
To: ProjectChrono <projec...@googlegroups.com>
Subject: Re: [chrono] DawSegments not showing line

 

Hi,

I didn't make the call between BeginScene and EndScene, it is working now but only when I make the call before vis->Render().

 

Thank you very much for a quick and helpful answer!

torsdag 5 oktober 2023 kl. 18:43:02 UTC+2 skrev Radu Serban:

Message has been deleted

Meninstick

unread,
Oct 6, 2023, 4:16:04 AM10/6/23
to ProjectChrono
Hi, I meant to write that it only works if I make the call after Render(), my bad!
Reply all
Reply to author
Forward
0 new messages