Archived

This topic is now archived and is closed to further replies.

Nickp3d

Particle engine check

Recommended Posts

Hey guys tring to build a particle engine that will load 4 differrent textures and each texture will have its own gravity, speed, life, fade, and posistion I jsut wanted to know if I am on the righ track If you can help or pull out any of the code below please do so.
    
#define MAX_PARTICLE 100


	HDC		hDC=NULL;
	HGLRC	hRC=NULL;
	HWND	hWnd=NULL;
	HINSTANCE	HInstance;

	//this right here is everything we will be able to type like

	bool keys[256];
	bool fullscreen=true;
	bool rainbow mode=false;
	bool active=true;
	bool sp;
	bool rp;
	bool fire;
	bool smoke;
	bool blood;

	
	float velocity=4.0f;
	float xspeed;
	float yspeed;
	float zoom=-40.0f;

	typedef struct
	{
	float life;
	float x;
	float y;
	float z;
	float fade;
	float xi;
	float yi;
	float zi;
	float xg;
	float yg;
	float zg;
	float timescale;

	}

	GLuint loop;
	GLuint delay;
	GLunit col;
	GLuint texture[1];
	GLuint texture[2];
	GLunit texture[3];
	GLunit texture[4];



	}

	particles;

	particles particle[MAX_PARTICLES];

	for(loop=0,loop><MAX_PARTICLES;loop++)
	{
		AUX_RBGImageRec *LoadBMP char (*filename)
		{
			FILE *File=NULL;
			if (if!filename);
			{
				if return NULL;
			}
			if File=fopen(Filename="r");
			{
				fclose(File);
				return auxDIBImageLoad(Filename);
			}
			return NULL;
		}

		int LoadGLTextures()
		{
			int Status=false;

			AUX_RGBImageRec *TextureImage[1];


		
		
		
		
		
		particle[loop].active=true;

		particle[loop].life=2.0f;
		particle[loop].fade=float(rand()100%)1000f+1.0f;

		V=float(rand()25%);
		Angle=float(rand()360%);

		particle[loop].xi=float((rand()50%-26.0f)*10.0f;
		particle[loop].yi=float((rand()50%-25.0f)*10.0f;
		particle[loop].zi=float((rand()50%-25.0f)*10.0f;

		particle[loop].xg=0.0f;
		particle[loop].yg=-9.8f;
		particle[loop].zg=0.0f;
		particle[loop].timescale = 0.6f;
  
EDIT SK: Code samples that large should be encased in SOURCE tags. [edited by - ShiningKnight on August 31, 2002 2:21:16 AM]

Share this post


Link to post
Share on other sites
1) Does it work as is??

2) If not, what errors are you getting?

You need to be a little more specific!



"With my feet upon the ground I lose myself between the sounds and open wide to suck it in, I feel it move across my skin. I''m reaching up and reaching out. I''m reaching for the random or what ever will bewilder me, what ever will bewilder me. And following our will and wind we may just go where no one''s been. We''ll ride the spiral to the end and may just go where no one''s been." - Maynard James Keenan
[TheBlackJester ]
[Wildfire Studios ]

Share this post


Link to post
Share on other sites
"bool rainbow mode=false;"

I would expect an error to stem from that one.

_____________________________

And the Phoenix shall rise from the ashes...

--Thunder_Hawk -- ¦þ
______________________________

Share this post


Link to post
Share on other sites
"typedef struct
{
float life;
float x;
float y;
float z;
float fade;
float xi;
float yi;
float zi;
float xg;
float yg;
float zg;
float timescale;

}

GLuint loop;
GLuint delay;
GLunit col;
GLuint texture[1];
GLuint texture[2];
GLunit texture[3];
GLunit texture[4];



}

particles;"

Now come on, you''ve got two closing brackets and one opening bracket.

_____________________________

And the Phoenix shall rise from the ashes...

--Thunder_Hawk -- ¦þ
______________________________

Share this post


Link to post
Share on other sites
quote:
Original post by Nickp3d


for(loop=0,loop> {
AUX_RBGImageRec *LoadBMP char (*filename)
{
FILE *File=NULL;
if (if!filename);
{
if return NULL;
}
if File=fopen(Filename="r");
{
fclose(File);
return auxDIBImageLoad(Filename);
}
return NULL;
}

int LoadGLTextures()
{
int Status=false;

AUX_RGBImageRec *TextureImage[1];




Ok, I didn''t want it to have to come down to this, but before you try to make a particle engine, learn how to program!





"With my feet upon the ground I lose myself between the sounds and open wide to suck it in, I feel it move across my skin. I''m reaching up and reaching out. I''m reaching for the random or what ever will bewilder me, what ever will bewilder me. And following our will and wind we may just go where no one''s been. We''ll ride the spiral to the end and may just go where no one''s been." - Maynard James Keenan
[TheBlackJester ]
[Wildfire Studios ]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
actually the code may not be appearing properly because lessthan''s and greaterthans will be interpreted as HTML tag start/finishes.

however if the code is appearing correctly, it must have been copied (badly) and pasted.

Share this post


Link to post
Share on other sites
Alright guys thanks for the help, but I still dont know the answer. Will this type engine be faster, or slower? Plus is there an easier way to do it?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Nickp3d
Alright guys thanks for the help, but I still dont know the answer.

Oh, did we help? I didn''t get the question.
quote:
Will this type engine be faster, or slower?

Is it a type engine you are trying to make, I thought it was a particle engine.
quote:
Plus is there an easier way to do it?

I could make a bet on it.

Share this post


Link to post
Share on other sites