Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,619 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
moving sun in game? #330835
06/30/10 06:23
06/30/10 06:23
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
is there a way i can get the sun to move? ive tried this:

Code:
var MoveSun;

function MoveSun_startup()
{
	while(1)
	{
		if(MoveSun)
		{
			sun_angle.pan += 1.25 * time_frame; 
			sun_angle.pan %= 360; 
			sun_angle.tilt = fsin(sun_angle.pan, 45) + 45;
			//sun_light = 2 * sun_angle.tilt;
			sun_light = 500;
		}
		wait(1);
	}
}




nothing works... help?


Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Re: moving sun in game? [Re: Doc_Savage] #330839
06/30/10 08:13
06/30/10 08:13
Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
Roel Offline
Senior Member
Roel  Offline
Senior Member

Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
first, sun light has a range of only 0....100
Let's assume that MoveSun is set
I think the code works, but the sun is a dynamic light.
so if you rotate the sun ingame, the rendered shadows on the blocks won't rotate with it.
however, stencil and projected shadows will.
This might be the problem.


Check out the throwing game here: The throwing game
Re: moving sun in game? [Re: Roel] #330904
06/30/10 18:26
06/30/10 18:26
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
hm...... how can i get them to move?


Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Re: moving sun in game? [Re: Doc_Savage] #330910
06/30/10 19:13
06/30/10 19:13
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
"hm...... how can i get them to move?"

What do you want to move, static shadows?


"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: moving sun in game? [Re: Superku] #330912
06/30/10 19:36
06/30/10 19:36
Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
Roel Offline
Senior Member
Roel  Offline
Senior Member

Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
Static shadows are unmoveable, the name says static.....
they are just baked into the level geometry.
The only way to have a real moving sun, with moving shadows would be the using of realtime rendered shadows. For the upcoming contest there is lightfrog which does that, and there is shadeC which also does. but for these you need your edition to support shadows.


Check out the throwing game here: The throwing game
Re: moving sun in game? [Re: Roel] #330925
06/30/10 20:51
06/30/10 20:51
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
And there is also a shadowmapping example in the folder of GStudio wink


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: moving sun in game? [Re: alibaba] #330941
07/01/10 02:56
07/01/10 02:56
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline OP
Member

Joined: Jan 2010
Posts: 145
shadowmapping... hm... i suppose i can get away with using this code in an open enviroment. because thats where i need it really, is there any way to rig this to some sort of sun object/glare sprite that represents the sun?


Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.

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

Gamestudio download | 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