Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 730 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Set Particle angles #461471
08/07/16 23:56
08/07/16 23:56
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
Hi, is it possible to give a particle pan and tilt angles during a particle effect? I mean currently they are automatic rotated to the camera view, but I want to set individual angles. Is that possible?

Re: Set Particle angles [Re: Benni003] #461477
08/08/16 07:48
08/08/16 07:48
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
AFAIK it's a pure 2D effect, i.e. no rotation or anything in that regard is involved.
If you want to have angles you will have to use sprites.

If you want to rotate a particle around the "camera-to-particle-axis", for example for smoke sprites or some other effect, you could create a bitmap array which has the particle in let's say 8 or more rotations (made in Photoshop/ ...) and then change the p.bmap pointer dynamically, similar to the sprite+8.tga feature.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Set Particle angles [Re: Superku] #461488
08/08/16 09:17
08/08/16 09:17
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
Okay, thank you Superku.

Re: Set Particle angles [Re: Benni003] #461489
08/08/16 09:38
08/08/16 09:38
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
While the result may not be want you want, you can try the 'Beam' or that other flag (forgot the name) for particles. It basically smears the particle in a line towards its destination. So in other words you can use the particle's velocity to give it some depth (think of e.g. lasers or bullet trails). The amount of smearing/stretching depends on the velocity.

Re: Set Particle angles [Re: Reconnoiter] #462093
09/08/16 15:38
09/08/16 15:38
Joined: Jun 2010
Posts: 212
tagimbul Offline
Member
tagimbul  Offline
Member

Joined: Jun 2010
Posts: 212
it possible
you can write in the particle event my.pan +=1;

Code:
// include lib:
#include <acknex.h>
#include <default.c>
//#include <mtlFX.c>
#include <particles.c>



function p_rot_event(ENTITY* p)
{
	
	var dreahspeed = 0.1;
	my.pan 	+= dreahspeed;
	my.tilt	+= dreahspeed;
	my.roll 	+= dreahspeed;
	
	
}

function particle_event_combo()
{
	p_fade_sprite(me);
	p_rot_event(me);
}

// sprite-emulated particle function
function p_sprite_shine(ENTITY* sprite)
{
	VECTOR vTemp;
	vec_randomize(vTemp,0.4);
	vec_add(sprite._VEL_X,vTemp);
	set(sprite,  BRIGHT | TRANSLUCENT);
	sprite.blue  = random(100); 
	sprite.green = random(1); 
	sprite.red   = random(255); 

	sprite.alpha = 50;
	sprite._SIZE = 2.5;
	sprite._FADE = 2.5;  // fade factor
	
	my.pan	=	random(360);
	my.tilt	=	random(180)-90;
	my.roll	=	random(360);
	
	sprite.event = particle_event_combo;	
}



action act_particle_sog()
{
	while(1)
	{
		effect_sprite("shine.png",p_sprite_shine,maxv(1,20*time_step),my.x,vector(0,0,2));
	 	wait(40);		
	}
}
function main ()
{
	video_window(NULL, NULL, NULL, "Flare Expansion");	
	level_load(NULL);
	ENTITY* particle_sog = ent_create(NULL,vector(0,0,0),act_particle_sog);  
	sky_color.red = 0;
	sky_color.green = 0;
	sky_color.blue = 0; 
	camera.x 	= -344;	

}



change flare2.png with a file on you computer. you need a png with alpha channel

Last edited by tagimbul; 09/08/16 16:00.

meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Re: Set Particle angles [Re: tagimbul] #462098
09/09/16 09:12
09/09/16 09:12
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: tagimbul
it possible
you can write in the particle event my.pan +=1;
In your example you aren't using particles, but sprites (entities). Maybe you aready knew this, I just wanted to make it clear.

Greets!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Set Particle angles [Re: 3run] #462100
09/09/16 09:50
09/09/16 09:50
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
That reminds me, you could use the shade-c EVO more efficient and better looking sprites, though shade-c has a few downsides but many big improvements, see this link for advantages/disadvantages and help with setting-up -> http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=461868&page=1

Last edited by Reconnoiter; 09/09/16 09:51.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1