-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Superfluid #84
Comments
If you have defined the viscosities as global variables in ofApp.h, then you should be able to use them in ofApp.cpp like this
Hope that helps |
Can you show me the link to your code? OpenFrameworks also has it's own serialization method but it's documentation is lacking : https://openframeworks.cc/documentation/types/ofBaseSerializer/ |
|
I peeked through your code, I couldn't find a mistake. These errors are hard to track and they are usually due to some casting errors or other hidden logical mistakes. I'll try a deeper look again when have time. Great job adding the additional colors! |
Thank you! Now I add probability for every type of interaction. So, an interaction will have; intensity, range, viscosity and probability of happening. |
yeah we should switch to some xml/json/yml file for import/export. |
If you will write this code in another programming language, please insert more comments in it. Please also make it easy to insert new colours. Please use the full matrices of interaction strengths as well as their probabilities and viscosity per colour. |
yes, I will :) It's still fully standard C++, it's part of the intel oneAPI.
it's a bit like "cuda" (except that it's not). you can already compile particle-life with it without any change. Except that it won't really show much improvement. particle life need to be fully rewritten :
|
I solved the problem with saving and loading. There was a mistake in my code. |
Hi! Viscosity quantifies the internal frictional force between adjacent layers of fluid that are in relative motion. So, Viscosity is a characteristic of the substance. So in this application it should be a parameter of the substance, i.e. the colour. So each colour should have its own viscosity. If a user wants to define red particles as superfluid they can do so by setting the red viscosity to zero.
I'd like to do that, but I have no idea how to define the velocity calculation on each color. I have defined the viscosity for each color, but I don't know how I could insert it into the p1.vx and p2.vy velocity calculation (how to make p1.vx and p2.vy refer to each color separately). Any ideas? Can you help me?
ofxFloatSlider viscoSliderR;
ofxFloatSlider viscoSliderG;
ofxFloatSlider viscoSliderW;
ofxFloatSlider viscoSliderB;
ofxFloatSlider viscoSliderO;
ofxFloatSlider viscoSliderK;
ofxFloatSlider viscoSliderC;
ofxFloatSlider viscoSliderD;
and
float viscosityR = 0.3F;
float viscosityG = 0.4F;
float viscosityW = 0.1F;
float viscosityB = 0.6F;
float viscosityO = 0.5F;
float viscosityK = 0.7F;
float viscosityC = 0.8F;
float viscosityD = 0.0F;
and
viscosityR = viscoSliderR;
viscosityG = viscoSliderG;
viscosityW = viscoSliderW;
viscosityB = viscoSliderB;
viscosityO = viscoSliderO;
viscosityK = viscoSliderK;
viscosityC = viscoSliderC;
viscosityD = viscoSliderD;
The text was updated successfully, but these errors were encountered: