CompuCell3D / cc3d-player5

CC3D Player 5
GNU Lesser General Public License v3.0
3 stars 3 forks source link

3D models in player are unusable #54

Open jpsluka opened 5 months ago

jpsluka commented 5 months ago

Player is failing to properly render 3D models. The problem is particularly bad when

  1. the models x, y and z dimension are all different.
  2. the model is built with cells touching the boundaries of the simulation.

But even if they dims are the same and cells don't touch the boundary the render is often wrong.

Here is what you get for a cube of cells using the UniformInitializer to create a solid region of cells. The model dim's are all the same. The 2D windows show a solid region of cells. The 3D render is missing the inner cells. Untitled2

If the model dims are all different, then the render makes different errors: Untitled (now the back wall is missing as well as all the interior cells)

In both cases the cell inventory count is consistent with a solid cube of cells, not with the number of cells shown in the 3D render.

If you move the cube of cells one pixel away from the wall, then the cells initially render correctly in 3D. But as the sim runs cells vanish from the 3D render even though the 2D views still show the cells and the cell inventory count does not change. test.zip

fyffep commented 5 months ago

Although I do not plan to fix this right away since my laptop struggles to handle 3D, my first thought is that this bug could be an issue with either:

  1. the lattice sites not being totally contiguous for each cell (or otherwise being placed in the wrong locations)
  2. the cell pointer not being reset properly whenever a new cell is created. Potentially relevant code: https://github.com/CompuCell3D/CompuCell3D/blob/9f96712fda7046b8cf15bff839ff3c6f2df0741e/CompuCell3D/core/CompuCell3D/steppables/UniformFieldInitializer/UniformFieldInitializer.cpp#L110
maciekswat commented 4 months ago

there is a new setting in configuration panel that you can toggle to switch between shell-only rendering and rendering of all cells:

with shell-opnly rendering image

Rendering all the cells

image

jpsluka commented 4 months ago

there is a new setting in configuration panel that you can toggle to switch between shell-only rendering and rendering of all cells:

with shell-opnly rendering image

Rendering all the cells

image

So the new setting doesn't render any cell that touches the model's boundaries?

maciekswat commented 4 months ago

That was optimization that was on all the time and the moment you used NeighborTracker it was producing 3D view that was rendering only shell cells (and those touching boundaries were considered shell cells because they had no contact with Medium) . With this PR you can turn off this behavior and all cells will be rendered - it will be slower but at least you will get what you want. . BTW this will come in 4.6.0 which should happen soon