Answer the question
In order to leave comments, you need to log in
How to do a virtual lab?
Hello. In general, I am faced with the task of doing a virtual 2d laboratory work related to fluid flow. That is, it should be a full-fledged application with a menu (there are two sections + a manual in the work).
As for the theory of fluid modeling, I seem to have found something:
https://www.graphicon.ru/html/2012/conference/RU3%...
but I have a weak idea of how to implement all this. I'm not a mega programmer, from the skills - only the basics of c ++. Can you please tell me what to do.
Answer the question
In order to leave comments, you need to log in
Most likely, "liquid" meant a simple pouring of pixels. I did this in the 7th grade on Pascal, on the Corvette 64K
if (снизу_пусто){ // сыплется вниз
y+=1
} else if (снизу_слева_пусто && снизу_справа_пусто){// сыплется по диагонали в случайную сторону
y+=1
if (rand()>0.5){
x-=1
}else{
x+=1
}
} else if (снизу_справа_пусто){ // сыплется вправо по диагонали
y+=1
x+=1
} else if (снизу_слева_пусто){ // сыплется влево по диагонали
y+=1
x-=1
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question