Visual assets are separate from collision assets associated with any given 
physics item in a Chrono model.  You will need to create a visualization model 
that includes shapes corresponding to your collision model (although you do not 
always have to match them exactly) and associate that with the body.  This is 
illustrated in many (most) of the Chrono demos.

By the way, I strongly encourage you to switch using a newer version of Chrono. 
 Version 9.0.0 was recently released.

--Radu

From: [email protected] <[email protected]> On Behalf 
Of Yaqing Wang
Sent: Monday, June 3, 2024 2:35 PM
To: ProjectChrono <[email protected]>
Subject: [chrono] Visualization for added collision shape

Hi,
I am now creating an eccentric ellipsoid. I want the mass all concentrated in a 
small ball a little bit lower than the center of geometry. I first create a 
ChBody, then add an ellipsoid to its collision model.
I am using Chrono v7. I am coding like this:

double robot_a = 0.118;
              double robot_b = 0.085;
              double robot_c = 0.033;
              auto robot = std::make_shared<ChBody>(collision_type);
              double inertia = (2.0 / 5.0) * AM_mass * pow(link_r, 2);
              robot->SetDensity(AM_density);
              robot->SetMass(AM_mass);
              robot->SetInertiaXX(ChVector<>(inertia, inertia, inertia));
              robot->SetPos(ChVector<>(x_start, y_e, height_e + AM_offset));
              robot->SetPos_dt(initial_v);
              robot->SetRot(QUNIT);
              robot->GetCollisionModel()->AddEllipsoid(material_PLA, robot_a, 
robot_b, robot_c, ChVector<>(0, 0, -AM_offset), ChMatrix33<>(1));
              robot->GetCollisionModel()->BuildModel();
              robot->SetCollide(true);
              robot->SetBodyFixed(false);
              auto robot_colorasset = std::make_shared<ChColorAsset>(0.2f, 
0.3f, 0.6f);
              robot_colorasset->SetFading(0.5);
              robot->AddAsset(robot_colorasset);
              mphysicalSystem.Add(robot);

I am having a problem with not being able to make this ellipsoid visible. I 
think there should be a few lines of code that make this happen. Would you show 
me?

Thanks,
--
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 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/projectchrono/e9a5fff4-1aa9-4469-a0af-373d73bfb008n%40googlegroups.com<https://urldefense.com/v3/__https:/groups.google.com/d/msgid/projectchrono/e9a5fff4-1aa9-4469-a0af-373d73bfb008n*40googlegroups.com?utm_medium=email&utm_source=footer__;JQ!!Mak6IKo!Pp7Z7Zs2b718cS7TlhPN4AuwEzhRtayhH2eMfHm_msAEdctaAv3V4VFTSwpWeRyCAqIu4mQ2iKZ4DPMpp0w66Q$>.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/projectchrono/CH3PPF46CDC2185FE0C0C3D2E38F64FBC8DA7C22%40CH3PPF46CDC2185.namprd06.prod.outlook.com.

Reply via email to