InteractiveComputerGraphics / PositionBasedDynamics

PositionBasedDynamics is a library for the physically-based simulation of rigid bodies, deformable solids and fluids.
MIT License
1.89k stars 358 forks source link

How to make transparent box in Demo #86

Closed kayarre closed 4 years ago

kayarre commented 4 years ago

Hi I was able to make an open container (5 sided cube) by editing PileScene.py, however I am unable to figure out how to make the static box appear transparent?

at first it seemed like the solution was to change float staticColor[4] = {0.5f, 0.5f, 0.5f, 1}; to float staticColor[4] = {0.5f, 0.5f, 0.5f, 0.2}; inside void DemoBase::render() but that didn't seem to change the colors in the demo. (I would assume there is no caching weirdness that would be happening? )

then it looked like Visualization::drawMesh was the solution to change glColor3fv to glColor4fv but that didn't seem to work either.

I am sure there is something super simple I am missing. can you point me in the right direction?

Thank you so much for this awesome library.

I was able to figure it out at least part of the way. I will provide a pull request to show the solution and see if that was the right to go about it.

I was able to add a isWall parameter to the RigidBody() class and have it skip rendering if true. but it doesn't give a sense of how big the box is.