|
0 registered members (),
635
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Aum82 ready
[Re: maslone1]
#252252
02/17/09 11:34
02/17/09 11:34
|
Joined: Aug 2004
Posts: 1,345 Kyiv, Ukraine
VeT
Serious User
|
Serious User
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
|
thats not exactly what i wanted to know, maybe i badly make my sentence i'm interested, if i'd use 2d objects (panels), that are shown on the screen(in 2d), could i use 3d particle effects... so wouldnt particles goes through the camera? maybe i'd need to create the explosion using vec_for_screen and moving it down from the screen (if i write it again not understandable, i'd make screenshot  PS: in first time i wanted to know, if there are 2d particles, that rendered right on the screen, like panel (we colud rendre weapon on the screen using
ENTITY* shotgun_onscreen =
{
type = "shotgun.mdl";
layer = 2; // display above view entities with layer 1
flags = VISIBLE;
flags2 = VISIBLE; // visible on screen from the start
client_id = camera; // same camera parameters as the default view
x = 100; // place 100 quants ahead of the view
y = -50; // 50 to the right
z = 0; // and center vertically
}
, so maybe there is something like that for particles
|
|
|
Re: Aum82 ready
[Re: VeT]
#252328
02/17/09 17:42
02/17/09 17:42
|
Joined: Jul 2007
Posts: 424 EUROPE
maslone1
Senior Member
|
Senior Member
Joined: Jul 2007
Posts: 424
EUROPE
|
Ok,... i think i understand what u mean. My answere is "Obama" -> "yes, you can"  You only have to set the vec[2] to zero. ( vec[2] = 0; ) My goal in my little project was, to create the starfield in every direction. If i would set the vec[2] to zero, the stars would only be created in x and y direction. // Hilfsfunktion: setzt den Vektor auf zufällige Richtung und Länge
function vec_randomize (var* vec, var range)
{
vec[0] = random(1) - 0.5;
vec[1] = random(1) - 0.5;
vec[2] = 0;
vec_normalize(vec,random(range));
}
// Hilfsfunktion: blendet einen Partikel aus
function part_alphafade(PARTICLE *p)
{
p.alpha -= 2*time_step;
if (p.alpha <= 0) p.lifespan = 0;
}
// Partikelfunktion: generiert eine verblassende Explosion in vel-Richtung
function effect_explo(PARTICLE *p)
{
var temp[3];
vec_randomize(temp,10);
vec_add (p.vel_x, temp);
p.alpha = 25 + random(25);
p.bmap = scatter_map;
p.flags |= (BRIGHT | MOVE);
p.event = part_alphafade; // wechsle zu einer kürzeren, schnelleren Funktion
}
...
vec_scale(normal,10); // produziere eine Explosion in Richtung der Normalen
effect(effect_explo,1000,my.x,normal);
cu Marcel
A8c, Blender, FlStudio, Unity3d
|
|
|
Re: Aum82 ready
[Re: maslone1]
#252375
02/17/09 22:46
02/17/09 22:46
|
Joined: Aug 2004
Posts: 1,345 Kyiv, Ukraine
VeT
Serious User
|
Serious User
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
|
and if i would move camera in 3d space ?  really i was asking about render particles on the screen with something like " client_id = camera;" but anyway you're on the right way: maybe it would be effect if i change particle's [2] coordinate to camera's coordinate... interesting, i may try this  thanks for idea 
|
|
|
Re: Aum82 ready
[Re: VeT]
#252410
02/18/09 06:23
02/18/09 06:23
|
Joined: Jul 2007
Posts: 424 EUROPE
maslone1
Senior Member
|
Senior Member
Joined: Jul 2007
Posts: 424
EUROPE
|
hmmm,.... whats the goal?
the camera only move on x and y direction, an the particle only exist in x and y direction. if your cam move in z direction, the particle have to move with the cam.
But i understand what you mean, and i havent tried it.... so i can't answere now.´
cu marcel
A8c, Blender, FlStudio, Unity3d
|
|
|
Re: Aum82 ready
[Re: maslone1]
#252439
02/18/09 09:39
02/18/09 09:39
|
Joined: Aug 2004
Posts: 1,345 Kyiv, Ukraine
VeT
Serious User
|
Serious User
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
|
//if your cam move in z direction, the particle have to move with the cam. why, if you set vec[2] = 0; ?  looking like you can move particles with camera if you would set vec[2] = camera.z; but what about rotating camera?  maybe George could help us? 
|
|
|
Re: Aum82 ready
[Re: VeT]
#252458
02/18/09 11:43
02/18/09 11:43
|
Joined: Jul 2007
Posts: 424 EUROPE
maslone1
Senior Member
|
Senior Member
Joined: Jul 2007
Posts: 424
EUROPE
|
deleted
Last edited by maslone1; 02/18/09 11:44.
A8c, Blender, FlStudio, Unity3d
|
|
|
Re: Aum82 ready
[Re: VeT]
#252459
02/18/09 11:43
02/18/09 11:43
|
Joined: Jul 2007
Posts: 424 EUROPE
maslone1
Senior Member
|
Senior Member
Joined: Jul 2007
Posts: 424
EUROPE
|
Oh, i see,.... you need it for 3d... ?dont u? but if you want rotate it with the cam you could use this: function rotate_rel(VECTOR* meentity, VECTOR* youentity, ANGLE* youangle, VECTOR* distanz)
{
vec_set(meentity.x,distanz);
vec_rotate(meentity.x,youangle.pan);
vec_add(meentity.x,youentity.x);
}
But u are in right... it would be easier with the cam-layer. I'll take a look at this "problem". Maybe i find the answere. ... or geoerge  .... cu marcel
Last edited by maslone1; 02/18/09 11:47.
A8c, Blender, FlStudio, Unity3d
|
|
|
Re: Aum82 ready
[Re: maslone1]
#252466
02/18/09 12:26
02/18/09 12:26
|
Joined: Aug 2004
Posts: 1,345 Kyiv, Ukraine
VeT
Serious User
|
Serious User
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
|
what about using for particles DECAL If a sprites' DECAL flag is set, the sprite will be oriented in world space according to its PAN, TILT, and ROLL angles, rather than facing the player, and it's back side won't be visible.
instead of rotating ? or, maybe, its just for sprites... yes, i need a particle explotion, but on the camera, in 2d
|
|
|
Re: Aum82 ready
[Re: VeT]
#252482
02/18/09 13:57
02/18/09 13:57
|
Joined: Jul 2007
Posts: 424 EUROPE
maslone1
Senior Member
|
Senior Member
Joined: Jul 2007
Posts: 424
EUROPE
|
... sorry, i don't know it (yet). but i'll try some variations. I'll write u, if i have an answere to this question.
Maybe George can answere faster.... George?
cu Marcel
A8c, Blender, FlStudio, Unity3d
|
|
|
|