# Source code - tetrahedron based particles system 2 (with source code)

**URL:** <https://discourse.libcinder.org/t/source-code-tetrahedron-based-particles-system-2-with-source-code/2033>\
**Category:** Gallery\
**Created:** [July 28, 2022, 10:28pm UTC](https://discourse.libcinder.org/t/source-code-tetrahedron-based-particles-system-2-with-source-code/2033 "2022-07-28T22:28:17Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/dan/32/886_2.png) [@Dan](https://discourse.libcinder.org/u/Dan)\
**Post date:** [July 28, 2022, 10:28pm UTC](https://discourse.libcinder.org/t/source-code-tetrahedron-based-particles-system-2-with-source-code/2033/1 "2022-07-28T22:28:17Z")

</div>

Hi all,

Another animation with a tetrahedron based particles system.

The video:  
[https://www.youtube.com/watch?v=MdtS2CaOMTk](https://www.youtube.com/watch?v=MdtS2CaOMTk)

The source code:  
[https://github.com/brainswitchMedia/Cinder-Samples/tree/master/hoofeli04](https://github.com/brainswitchMedia/Cinder-Samples/tree/master/hoofeli04)

 ![1_2193](https://canada1.discourse-cdn.com/flex030/uploads/libcinder/original/2X/2/2e7776c354bde002866311b64150ae3fa3587658.jpeg)

---

<div class="post-metadata">

**Author:** ![brucelane](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/brucelane/32/541_2.png) [@brucelane](https://discourse.libcinder.org/u/brucelane)\
**Post date:** [August 5, 2022, 4:30pm UTC](https://discourse.libcinder.org/t/source-code-tetrahedron-based-particles-system-2-with-source-code/2033/2 "2022-08-05T16:30:45Z")

</div>

Hi Dan,  
I really like the dynamics of video with the music, congrats!  
I tryed to compile your project, at run-time it crashes apparently on the vbomeshes creation (I’m on Windows)

Bruce

---

<div class="post-metadata">

**Author:** ![Dan](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/dan/32/886_2.png) [@Dan](https://discourse.libcinder.org/u/Dan)\
**Post date:** [August 6, 2022, 9:30pm UTC](https://discourse.libcinder.org/t/source-code-tetrahedron-based-particles-system-2-with-source-code/2033/3 "2022-08-06T21:30:37Z")

</div>

Hi Bruce,

Thanks for the feedback. I will try to compile it on my side, I removed unsused code directly on github, I did perhaps something wrong, I will check that. If I understand well you do not have any errors, it crashes. Can you say me when, Update or Draw method?

Dan

---

<div class="post-metadata">

**Author:** ![brucelane](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/brucelane/32/541_2.png) [@brucelane](https://discourse.libcinder.org/u/brucelane)\
**Post date:** [August 6, 2022, 10:10pm UTC](https://discourse.libcinder.org/t/source-code-tetrahedron-based-particles-system-2-with-source-code/2033/4 "2022-08-06T22:10:51Z")

</div>

in this loop, after 6 iterations if I remember well: [Cinder-Samples/hoofeli04App.cpp at master · brainswitchMedia/Cinder-Samples · GitHub](https://github.com/brainswitchMedia/Cinder-Samples/blob/master/hoofeli04/src/hoofeli04App.cpp#L490)

---

<div class="post-metadata">

**Author:** ![Dan](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/dan/32/886_2.png) [@Dan](https://discourse.libcinder.org/u/Dan)\
**Post date:** [August 9, 2022, 3:23pm UTC](https://discourse.libcinder.org/t/source-code-tetrahedron-based-particles-system-2-with-source-code/2033/5 "2022-08-09T15:23:37Z")

</div>

Hi Bruce,

It should be fine now. I don’t know what happened but I messed up the code.

Just some information:

- you should better create a knew project in your directory, copy the files and replace the code in the project file. This project is not in a Cinder-Samples folder on my side. I clean the codes and paste them in a separate Cinder-Samples git folder to share them ( which is a stupid idea, I should modify this… may be )

- The program will try to read the “audio.xml” file if you press “p”. This file is in the xcode/build/Debug/ folder, so don’t forget to copy/paste it in your Debug folder after compiling.

Can you test and tell me if it is ok.

Dan

---

<div class="post-metadata">

**Author:** ![brucelane](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/brucelane/32/541_2.png) [@brucelane](https://discourse.libcinder.org/u/brucelane)\
**Post date:** [August 11, 2022, 7:53am UTC](https://discourse.libcinder.org/t/source-code-tetrahedron-based-particles-system-2-with-source-code/2033/6 "2022-08-11T07:53:02Z")

</div>

I created a new project, it compiles and runs after some modifications.  
The audio.xml is loaded when I press the p key.  
The UI is displayed, but nothing is drawn.  
Thanks,  
Bruce

---

<div class="post-metadata">

**Author:** ![Dan](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/dan/32/886_2.png) [@Dan](https://discourse.libcinder.org/u/Dan)\
**Post date:** [August 11, 2022, 10:55am UTC](https://discourse.libcinder.org/t/source-code-tetrahedron-based-particles-system-2-with-source-code/2033/7 "2022-08-11T10:55:34Z")

</div>

Nothing is drawn… you should see something. You do not need to press p, you should have something on the screen. What did you modify?

---

<div class="post-metadata">

**Author:** ![Dan](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/dan/32/886_2.png) [@Dan](https://discourse.libcinder.org/u/Dan)\
**Post date:** [August 11, 2022, 11:05am UTC](https://discourse.libcinder.org/t/source-code-tetrahedron-based-particles-system-2-with-source-code/2033/8 "2022-08-11T11:05:28Z")

</div>

Try to press 1 or 2 or 3 those are sequences test.

You can also modify line 1029:  
`const gl::ScopedTextureBind scopedTextureBind0( mTexturemRender[4], 0 );`

by changing the texture like this:  
`const gl::ScopedTextureBind scopedTextureBind0( mTexturemRender[0], 0 );`

---

<div class="post-metadata">

**Author:** ![Dan](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/dan/32/886_2.png) [@Dan](https://discourse.libcinder.org/u/Dan)\
**Post date:** [August 11, 2022, 12:24pm UTC](https://discourse.libcinder.org/t/source-code-tetrahedron-based-particles-system-2-with-source-code/2033/9 "2022-08-11T12:24:22Z")

</div>

If it does not work, can you share your project on Github, I will compile it on my computer

---

<div class="post-metadata">

**Author:** ![brucelane](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/brucelane/32/541_2.png) [@brucelane](https://discourse.libcinder.org/u/brucelane)\
**Post date:** [August 13, 2022, 4:38pm UTC](https://discourse.libcinder.org/t/source-code-tetrahedron-based-particles-system-2-with-source-code/2033/10 "2022-08-13T16:38:38Z")

</div>

I just added using namespace ci::app; to some .h files, changed audio.xml to load from assets.  
Pressing 1 or 2 or 3 doesn’t show anything.  
Repo: [GitHub - brucelane/MeBrainHurts](https://github.com/brucelane/MeBrainHurts)  
Let’s talk via github issues?  
Thanks

---

<div class="post-metadata">

**Author:** ![Dan](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/dan/32/886_2.png) [@Dan](https://discourse.libcinder.org/u/Dan)\
**Post date:** [August 18, 2022, 10:21pm UTC](https://discourse.libcinder.org/t/source-code-tetrahedron-based-particles-system-2-with-source-code/2033/11 "2022-08-18T22:21:47Z")

</div>

I will have a look next week. There is certainly a shader issue somewhere. Verify if there are shader compile errors, try to replace #version 330 core with #version 400. Yes we can move on Github, you can also reach me on Instagram, I’m already following you.
