Jump to content
Developer Wiki and Function Reference Links ×

Set Sun Position


IanH

Recommended Posts

I am looking at writing a script part of which will create then update a number of suns (lights) as if they were created with Set Sun Position.

Does anyone know if the algorithm for set sun position is accessible from vectorscript (bearing in mind that I need to update some of the parameter values across multiple instances of the light) or where I can find an alternative algorithm. A while back I found a couple of web sites with various algorithms but unfortunately the interesting links were out of date and the others were not quite what I was looking for - either fixed location, some other parameter not doing what I was expecting or me being mathematically challenged.

The parameters that I expect to update are likely to be lat/long/timezone (at creation), then page north, date and time as required.

The script is similar to create solar animation but either for a static time or a cumulative set of sun positions over a range of times.

Thanks

Ian

Link to comment

That's quite similar to what I am looking at writing, but a bit more complex.

I am basically writing a North Point but the text is sensitive to page orientation. I had 70% completed that. I am now looking at adding lights representing the sun to that, so North Point and sun orientation remain in synch. It would also allow multiple simultaneous suns (say am/midday/pm or even every hour) so that you can average light levels over the course of the day).

At the moment, sun positions are not linked to North Point except via re-entering the sun position each time and when I create multiple suns representing different times of the day/year, I end up having to create multiple sun positions which can be error prone - I thought it would be a perfect starter pio for me to write until I decided to add the sun positions and realised that I probably did not have access to the VW 'set sun position' algorithm and had to write my own - not a problem if I could find a compatible algorithm.

Link to comment

I think that this probably the best way of handling the problem. Slightly more complex in having to manage creating and deleting the sun/lights, but being able to utilise the set sun position algorithm, albeit indirectly, will outweigh implementing my own algorithm. Thanks for the suggestion.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...