I need to add some lines on top of the agent’s polygon to represent its properties. However, I am currently stuck at grouping the output of two functions in the following line: Group([agent_poly, agent_orientation])
.
const animal_shape = Polygon(Point2f[(-0.5, -0.5), (1, 0), (-0.5, 0.5)])
function draw_animal(live::Object)
φ = atan(live.orientation_matrix[2], live.orientation_matrix[1])
agent_poly = scale(rotate2D(animal_shape, φ), live.weight/15)
agent_orientation = lines([Point2f(0, 0), Point2f(live.orientation_matrix[1], live.orientation_matrix[2])])
Group([agent_poly,agent_orientation])
end
GLMakie.activate!()
fig, abmobs = abmexploration(model;
agent_step! = life!, model_step! = dummystep,
am = draw_animal,
ac=:blue,
)
display(fig)
How do i do it the right way?