Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / [SOLVED] ISO : Video or tutorial on how to use the sun commands

Author
Message
Loktofeit
AGK Developer
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 12th Jan 2022 18:59
Looking to have day and night with sunlight that moves across the sky,
but the sun commands don't seem to have any examples in either AGK2 or AGKS.
Videos, written guides, online tutorials, usage examples... will take whatever you've got.
LynxJSA's web games/quizzes - LynxJSA's Android apps
AGK Resource Directory
"Stick to a single main loop (DO...LOOP) and loop through it every frame.
Do everything inside functions.
Use finite state machines to control your game.
Use lots and lots of source files.

The author of this post has marked a post as an answer.

Go to answer

jd_zoo
5
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 13th Jan 2022 02:37
I believe with sun there is only really the color and direction commands. So based on moving it along an arc you could manually create a day/night cycle.

There is a skybox which has also has sun settings, I believe they will provide visual representation of the sun which may be what you are looking for above the shadows from moving it.
https://www.appgamekit.com/documentation/Reference/3D/SetSkyBoxSunVisible.htm
Loktofeit
AGK Developer
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 13th Jan 2022 23:05
This post has been marked by the post author as the answer.
ty, jd, but there's nothing really on that page (or the pages for most related commands), which is why I was looking for videos, written guides, online tutorials, usage examples.
LynxJSA's web games/quizzes - LynxJSA's Android apps
AGK Resource Directory
"Stick to a single main loop (DO...LOOP) and loop through it every frame.
Do everything inside functions.
Use finite state machines to control your game.
Use lots and lots of source files.
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 14th Jan 2022 09:15 Edited at: 14th Jan 2022 09:16
@Loktofeit, I attempted this once and shared an example on Discord. It usese a gradient image, memblocks and a loop to go through that memblock changing the sky/light colour. Setting the speed of the loop will give you shorter or longer days

https://discord.com/channels/436107917037404160/436108318755258369/761939850839982100

If you scroll up in that chat you can see the different attempts as I worked on it. One or two messages after that one I linked to you will see the 3 gradient images it uses

I've uploaded the project here but check out the discord post too where you will see a video of it in action and a bit more detail about it

Attachments

Login to view attachments
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 14th Jan 2022 09:24 Edited at: 14th Jan 2022 09:32
I couldn't see you on Discord with the same name so will share the video here.

One thing I had issue with was shadows at night because I think the light source was underneath at that time of day. I didn't have the experience or knowledge to fix that.

The number at the top left of the video is the hour of the day.

Attachments

Login to view attachments
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 18th Jan 2022 18:09 Edited at: 18th Jan 2022 18:32

Attachments

Login to view attachments
Lokto
FPSC Reloaded TGC Backer
4
Years of Service
User Offline
Joined: 19th Sep 2019
Location:
Posted: 26th Jan 2022 13:47
My apologies for the late reply, and ty so much for the info! It's exactly what I needed.

Login to post a reply

Server time is: 2024-03-28 08:51:19
Your offset time is: 2024-03-28 08:51:19