问题
I have a person agent who has a 3D representation of a man (default 3D pic of a human from anylogic). Can we change color of that 3D person agent's representation based on states? For example, when a agent moves from state A to B, it will change color from yellow to red. How to do that? I tried with shapeFillColor but anylogic is not detecting that 3D human representation as a shape (like polygons, triangle), statechart is not taking my command. Is it like we can only change the agent's color if that agent is manually drawn with some polygon? Will appreciate any feedback. Thanks,
agent's 3D representation
回答1:
You can do it as follows, it is not 100% intuitive:
- Check your 3D model properties and note the material names (for example "Material__6__Surf" --> NOTE: it has 2 underscores before and after the number!!)
- At runtime, simply call
worker.setColor("Material__6__Surf", red);
and the respective color will change (in this case the trousers)
来源:https://stackoverflow.com/questions/61903858/how-can-we-change-3d-animation-object-agents-representation-color-based-on-sta