Hirogens
Member
|
Code draw nothing !!!!
Hi all,
This code draw nothing...but the demo of suns.cpp work perfectly
Have you a solution ?
regards
Christophe [Hirogens]
Code:
#pragma pack()
struct PosG
{
double X;
double Y;
double Z;
};
PosG PositionGalaxie[100];
int NbStars = 0;
int Cpt = 0;
Sun sunTab[100];
chargeFichierGalaxy();
for (Cpt = 0;Cpt < 100;Cpt++)
{
sunTab[Cpt] = Suns.New();
sunTab[Cpt].set(*Images("gfx/sky/sun.gfx"));
sunTab[Cpt].pos = !Vec((Flt)PositionGalaxie[Cpt].X, (Flt)PositionGalaxie[Cpt].Y, (Flt)PositionGalaxie[Cpt].Z);
}
|
|
05-28-2009 08:05 AM |
|
Esenthel
Administrator
|
Re: Code draw nothing !!!!
You shouldn't use additional Sun objects 'Sun sunTab[100];'
but please use 'Suns' container instead
|
|
05-28-2009 11:47 AM |
|
Hirogens
Member
|
Re: Code draw nothing !!!!
hi,
have you an example ?
regards
|
|
05-28-2009 05:39 PM |
|
Esenthel
Administrator
|
Re: Code draw nothing !!!!
use reference
Sun &sun=Suns.New();
or suns array after it has been created
Suns[i]
|
|
05-28-2009 05:42 PM |
|
Hirogens
Member
|
Re: Code draw nothing !!!!
Ok work..
But another question.
I have 100 suns at Screen, but if i move the Cam , nothing move at screen.. ?
normal ?
regards
|
|
05-28-2009 05:58 PM |
|
Esenthel
Administrator
|
Re: Code draw nothing !!!!
only camera rotations affect the suns (not camera movement)
|
|
05-28-2009 06:16 PM |
|
Hirogens
Member
|
Re: Code draw nothing !!!!
Ok,
I can't use Suns for draw my galaxy...
regards
|
|
05-28-2009 06:21 PM |
|
Esenthel
Administrator
|
Re: Code draw nothing !!!!
please use particles for space simulation (especially manual drawing)
|
|
05-28-2009 06:24 PM |
|
Hirogens
Member
|
Re: Code draw nothing !!!!
Particle ?!,
But I must click on each stars...I can click on particle ? and get the coordinnate ?
regards
|
|
05-28-2009 07:03 PM |
|
Esenthel
Administrator
|
Re: Code draw nothing !!!!
please use these functions:
Code:
Bool DrawParticleBegin(Image &image,Byte glow ); // call this at start of drawing particles, 'glow'=glow amount 0..255, false on fail
void DrawParticleAdd (Color color,Flt opacity,Flt radius,Flt angle,Vec &pos,Vec &vel); // call this repeatedly for each particle
void DrawParticleEnd ( ); // call this after drawing all particles
|
|
05-28-2009 07:06 PM |
|
Hirogens
Member
|
Re: Code draw nothing !!!!
Esenthel Wrote:please use these functions:
Code:
Bool DrawParticleBegin(Image &image,Byte glow ); // call this at start of drawing particles, 'glow'=glow amount 0..255, false on fail
void DrawParticleAdd (Color color,Flt opacity,Flt radius,Flt angle,Vec &pos,Vec &vel); // call this repeatedly for each particle
void DrawParticleEnd ( ); // call this after drawing all particles
I have search in entire directory, and I no found example to use it.
regards
|
|
05-28-2009 07:20 PM |
|
Esenthel
Administrator
|
Re: Code draw nothing !!!!
Hi,
this is a sample
Code:
inline void DrawParticle(Image &image,Byte glow,Color color,Flt opacity,Flt radius,Flt angle,Vec &pos,Vec &vel) // draw a single particle
{
if(DrawParticleBegin(image,glow))
{
DrawParticleAdd(color,opacity,radius,angle,pos,vel);
DrawParticleEnd();
}
}
it's in the particles header file, just below the mentioned functions
this function is also used in Bloody Massacre (DrawParticle)
|
|
05-28-2009 07:28 PM |
|
Hirogens
Member
|
Re: Code draw nothing !!!!
Esenthel Wrote:Hi,
this is a sample
Code:
inline void DrawParticle(Image &image,Byte glow,Color color,Flt opacity,Flt radius,Flt angle,Vec &pos,Vec &vel) // draw a single particle
{
if(DrawParticleBegin(image,glow))
{
DrawParticleAdd(color,opacity,radius,angle,pos,vel);
DrawParticleEnd();
}
}
it's in the particles header file, just below the mentioned functions
this function is also used in Bloody Massacre (DrawParticle)
I have try all the night... don't work
Can you write a little example ?
regards
Christophe
|
|
05-29-2009 06:24 AM |
|
Esenthel
Administrator
|
Re: Code draw nothing !!!!
Hi,
A sample usage is in Bloody Massacre,
This is just a Particle drawing function, which can be called instead of Particles::draw
|
|
05-29-2009 10:25 AM |
|
Hirogens
Member
|
Re: Code draw nothing !!!!
Esenthel Wrote:Hi,
A sample usage is in Bloody Massacre,
This is just a Particle drawing function, which can be called instead of Particles::draw
Sorry, I can't draw a particle..Nothing draw...
regards
Christophe
|
|
05-30-2009 06:17 AM |
|