ManimCommunity / ManimCommunity/manim

Point always visible through other objects in `ThreeDScene` when using Cairo

Open
#2,174 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

issue:bug
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## Description of bug / unexpected behavior
`Point` objects are always visible when in a `ThreeDScene`, even when they should be occluded by other objects.

## Expected behavior
If a point is behind or inside another object it should not be visible. Just like in a 2D scene.

## How to reproduce the issue
Place a `Point` in a `ThreeDScene` behind or inside another object. Here I have placed a point inside a cube and it is still visible.

Code for reproducing the problem

```py
class PointInsideCube(ThreeDScene):
def construct(self):
self.add(Point(color=BLACK))
self.add(Cube(side_length=2, fill_opacity=1.0))
self.wait(1)
```

If the `ThreeDScene` in the above example is replaced with `Scene` the desired behavior is achieved.

## Additional media files

Frame using `ThreeDScene`

![ThreeDScene](https://user-images.githubusercontent.com/44180586/136645070-0b5b19cf-e119-4ec7-8f55-cc44ca9bdd26.png)

Frame using `Scene`

![Scene](https://user-images.githubusercontent.com/44180586/136645082-7c19fee3-94b3-47a6-9baa-2391c4280d5d.png)

## Additional comments
I don't know if this is expected behavior for `ThreeDScene` but it doesn't seem right to me. I tried the `shade_in_3d=True` keyword argument that is listed in #2032 but `Point` does not accept it and it has no effect on `Cube`. Am I missing something else?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided PointInsideCube reproduction and compare the output from ThreeDScene with Scene. Trace how ThreeDScene renders or orders Point and Cube objects under Cairo. Done means a point behind or inside an opaque object is no longer visible in ThreeDScene, while the existing 2D behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.