Flame Painter Dev Thread
Moderator: Coders of Rage
Re: Flame Painter Dev Thread
My attempt, i have a few parameters like noise, focus, force, and size, kinda tried to just emulate the applet thing.
If anyone is interested I'll chuck the source out there.
If anyone is interested I'll chuck the source out there.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
Dad, "Yea well I have a fan belt in street fighting"
-
- Chaos Rift Demigod
- Posts: 991
- Joined: Thu Nov 13, 2008 3:16 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Amiga, PSOne, NDS
- Programming Language of Choice: C++
- Location: Sweden
Re: Flame Painter Dev Thread
Nice, and please doavansc wrote:My attempt, i have a few parameters like noise, focus, force, and size, kinda tried to just emulate the applet thing.
If anyone is interested I'll chuck the source out there.
- xiphirx
- Chaos Rift Junior
- Posts: 324
- Joined: Mon Mar 22, 2010 3:15 pm
- Current Project: ******** (Unkown for the time being)
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Contact:
Re: Flame Painter Dev Thread
Since I sorta want to do this on my own... no D:avansc wrote:My attempt, i have a few parameters like noise, focus, force, and size, kinda tried to just emulate the applet thing.
If anyone is interested I'll chuck the source out there.
Just shows my shitty physics skills since you got way better results in one build :P
StarCraft II Zerg Strategy, open to all levels of players!
Looking for paid work :< Contact me if you are interested in creating a website, need a web design, or anything else you think I'm capable of
Looking for paid work :< Contact me if you are interested in creating a website, need a web design, or anything else you think I'm capable of
Re: Flame Painter Dev Thread
I'll just put the zip up.xiphirx wrote:
Since I sorta want to do this on my own... no D:
Just shows my shitty physics skills since you got way better results in one build :P
I use almost no physics on this one, this is literally the only physics, and that just describes the motion of a independent particle.
Code: Select all
void Painter::update(const float dt)
{
this->vel.x += this->accel.x * dt;
this->vel.y += this->accel.y * dt;
this->pos.x += this->vel.x*dt + (this->accel.x*dt*dt)/2;
this->pos.y += this->vel.y*dt + (this->accel.y*dt*dt)/2;
this->accel.x = 0;
this->accel.y = 0;
this->vel.x *= 0.999;
this->vel.y *= 0.999;
}
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
Dad, "Yea well I have a fan belt in street fighting"
- xiphirx
- Chaos Rift Junior
- Posts: 324
- Joined: Mon Mar 22, 2010 3:15 pm
- Current Project: ******** (Unkown for the time being)
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Contact:
Re: Flame Painter Dev Thread
Thanks for that.
I'm currently trying to fix my delta timing stuff... timestep is messing up when you fullscreen it :/
I'm currently trying to fix my delta timing stuff... timestep is messing up when you fullscreen it :/
StarCraft II Zerg Strategy, open to all levels of players!
Looking for paid work :< Contact me if you are interested in creating a website, need a web design, or anything else you think I'm capable of
Looking for paid work :< Contact me if you are interested in creating a website, need a web design, or anything else you think I'm capable of
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Flame Painter Dev Thread
Out of curiosity, where in the world did you come up with that code, avansc?
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
Re: Flame Painter Dev Thread
These are all just kinematic motion equations.dandymcgee wrote:Out of curiosity, where in the world did you come up with that code, avansc?
okay lets take a look
the first bit is the velocity equation, accel here really is just a force acting on the particle.
this->vel.x += this->accel.x * dt;
this->vel.y += this->accel.y * dt;
Velocity_final = Velocity_initial + acceleration * delta_time // acceleration pertime gives velocity
now that we have out current velocity we can use the displacement equation. i just used this one, but there are many, V = D/T and so on.
this->pos.x += this->vel.x*dt + (this->accel.x*dt*dt)/2;
this->pos.y += this->vel.y*dt + (this->accel.y*dt*dt)/2;
I reset the "force"
this->accel.x = 0;
this->accel.y = 0;
This part just dampens there velocity, a kind of friction if you will.
this->vel.x *= 0.999;
this->vel.y *= 0.999;
}
http://en.wikipedia.org/wiki/Kinematics
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
Dad, "Yea well I have a fan belt in street fighting"
- xiphirx
- Chaos Rift Junior
- Posts: 324
- Joined: Mon Mar 22, 2010 3:15 pm
- Current Project: ******** (Unkown for the time being)
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Contact:
Re: Flame Painter Dev Thread
Hmm... So I tried to put what you had in your update function avansc, but I get pretty bad results... How do you calculate the acceleration?
StarCraft II Zerg Strategy, open to all levels of players!
Looking for paid work :< Contact me if you are interested in creating a website, need a web design, or anything else you think I'm capable of
Looking for paid work :< Contact me if you are interested in creating a website, need a web design, or anything else you think I'm capable of
Re: Flame Painter Dev Thread
being bored.
http://img443.imageshack.us/img443/1778 ... 8at422.png
something like that.
http://img443.imageshack.us/img443/1778 ... 8at422.png
something like that.
Code: Select all
for(int a = 0;a < MAX;a++)
{
cVec2 t = cVec2(tx,ty);
t -= it[a]->pos;
//t.normalize();
/*
FORCE = general attraction force : 0.3f
FOCUS = total spread : 1.0f
SPRING = force that keeps ajacent particles together : 10.0f
*/
float f = ((a+1)/(float)MAX)/FORCE*(FOCUS - ((a+1)/((float)MAX+SPRING)));
t*=f;
//apply accel
it[a]->accel.setX(t.getX());
it[a]->accel.setY(t.getY());
//some noise
it[a]->vel.x += (NOISE*(rand()%1000/999.0f-0.5f));
it[a]->vel.y += (NOISE*(rand()%1000/999.0f-0.5f));
}
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
Dad, "Yea well I have a fan belt in street fighting"
Re: Question about Math and Algorithm
That's exactly what I did, and its a bad ass one :Ddandymcgee wrote:That would make an awesome screensaver.
- GroundUpEngine
- Chaos Rift Devotee
- Posts: 835
- Joined: Sun Nov 08, 2009 2:01 pm
- Current Project: mixture
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Location: UK
Re: Question about Math and Algorithm
This looks awesome!
Agreed!dandymcgee wrote:That would make an awesome screensaver.
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Flame Painter Dev Thread
This thread is win. Avansc is a bamf!
- MrDeathNote
- ES Beta Backer
- Posts: 594
- Joined: Sun Oct 11, 2009 9:57 am
- Current Project: cocos2d-x project
- Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
- Programming Language of Choice: C/++
- Location: Belfast, Ireland
- Contact:
Re: Flame Painter Dev Thread
Did you ever put this up, i'd definitely like to have a look at the sourceavansc wrote: I'll just put the zip up.
http://www.youtube.com/user/MrDeathNote1988
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
Re: Flame Painter Dev Thread
I'll get on that, It's just very very messy atm. but i'll chuck something out there.MrDeathNote wrote:Did you ever put this up, i'd definitely like to have a look at the sourceavansc wrote: I'll just put the zip up.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
Dad, "Yea well I have a fan belt in street fighting"