0 registered members (),
1,295
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: STREAK/BEAM not working correctly
[Re: uniman]
#313297
02/28/10 17:09
02/28/10 17:09
|
Joined: Oct 2004
Posts: 900 Lgh
rojart
User
|
User
Joined: Oct 2004
Posts: 900
Lgh
|
Perhaps I have the same bug. If you create a particle with the BEAM flag there is a horizontal line from the particle position to the right side of the screen BEAM & STREAK only work with Gamestudio/A7 Commercial+ version (Low versions don't support BEAM), what version of A7 do you use? When pro then post your whole code to check what happens.
Last edited by rojart; 02/28/10 17:15.
|
|
|
Re: STREAK/BEAM not working correctly
[Re: uniman]
#313309
02/28/10 17:51
02/28/10 17:51
|
Joined: Oct 2004
Posts: 900 Lgh
rojart
User
|
User
Joined: Oct 2004
Posts: 900
Lgh
|
Can you extend this code with your cam code?
///////////////////////////////
// Particle trail example
// (c) jcl / oP group 2009
// Gamestudio/A7 Commercial+ only
// Low versions don't support BEAM
///////////////////////////////
#include <acknex.h>
#include <default.c>
function p_alphafade(PARTICLE *p)
{
p.alpha -= p.skill_a*time_step;
if (p.alpha <= 0) p.lifespan = 0;
}
function p_trace(PARTICLE *p)
{
set(p,TRANSLUCENT|BEAM);
p.alpha = 100;
p.size = 2;
p.skill_a = 3; // fade factor
p.event = p_alphafade;
}
action satellite()
{
var dist = 0,radius = 10,sign = 1;
VECTOR last_pos;
while(1)
{
vec_set(last_pos,my.x);
dist += 30*time_step;
radius += sign*random(2)*time_step;
if (radius > 100) sign = -1;
else if (radius < 10) sign = 1;
my.x = radius*sin(dist);
my.y = radius*cos(dist);
effect(p_trace,1,my.x,vec_sub(last_pos,my.x));
wait(1);
}
}
function main()
{
vec_set(screen_size,vector(800,300,0));
vec_set(sky_color,vector(50,1,1)); // dark blue
d3d_antialias = 4;
video_window(NULL,NULL,0,"Particle trail demo");
level_load(NULL); // necessary for 3D particles
vec_set(camera.x,vector(-150,0,20));
vec_set(camera.pan,vector(0,-10,0));
vec_set(mat_model.ambient_blue,sky_color);
ent_create(SPHERE_MDL,vector(0,0,0),NULL);
ent_create(NULL,vector(0,0,0),satellite);
}
|
|
|
|