Sun position plugin

User avatar
redmotion
Posts: 150
Joined: 09 Jun 2009, 18:38
Location: London
Contact:

Sun position plugin

Post by redmotion » 02 Aug 2009, 12:46

Sun Position Property v2010/2011 - Written by Jason Wells - Redmotion - based on Radiance renderer


A local copy can be found here:
sunposition2011.zip
(59.67 KiB) Downloaded 657 times
--------
Based on standard sun position algorhythms (NOT actual sunposition data sets) It seems pretty reliable, however:

IF YOU USE THIS SOFTWARE, YOU AGREE TO DO IT AT YOUR OWN RISK, YOU AGREE THAT THE ACCURACY OF THIS PLUGIN CANNOT BE GUARANTEED IN ANY WAY AND THAT THE CREATOR ACCEPTS NO RESPONSIBILITY FOR ANY LOSSES OR DAMAGES INCURRED BY THE USE OF THIS PLUGIN.

This article is for v2010/2011 only, please see below to archived v7 post for v7 and below.

--------
I'd like to thank mslaf and mabxsi of Xsibase for their advice regarding some nasty little details in regards to combo boxes.
--------
CHANGES AND FIXES
- New CITY parameter which updates Latitude, Longitude and Timezone properties, featuring 120 cities from around the world. Some city locations may give inaccurate results. Most likely candidates have a * at the end of their name.
- Debug checkbox - tick to show calcualtion results
- Note that Longitude East is actually a negative value and West is a positive value, some users would have found problems with previous versions of the plugin if longitude settings were extreme.
- Updated documentation
--------
LIMITATIONS
- No animation - (Originally built as a property in XSI Foundation (restriction against creation of scripted ops) - needs to be transfered to operator setup.
- No entry for hours and minutes/Longitude/Latitude in standard formats.
--------
INSTALLATION
Place the sunposition2010.dll and sunPlugin.vbs script file into the \Application\Plugins folder of your v2010 user folder.
(you may try the workgroup folder but it may not work)
--------
USAGE/VIDEOS
For info how to use v7, check out the video here:
http://redmotion.blogspot.com/2008_02_01_archive.html
For info on how to use v2010, check out this video:
http://www.vimeo.com/6738792
--------
Written Instructions to get the sun working:
This is a property that rotates the selected object to point towards the suns position in the sky at a specific point in time.
1. Install the plugins (put both the sun_primitive and sunposition plugins into the plugins folder - user or workgroup
2. Get > Primitives > Light > Sun. It will create an infinite light attached to a null.
NOTE: To move the infinite light away or towards the scene centre, select the sun, press F3 and double-click on the "Sun" property. Use the slider to set a new distance from the centre.
3. Select the null (called "centre").
4. Get > Property > Sun Position
5. A dialogue box will open.
6. Set the time and date using the sliders to position the sun.

--------
USING WITH THE V6, V7 and V2010 MENTAL RAY PHYSICAL SUN AND SKY SHADERS
NB: If you use the Kobayashi Xsiaddon, it will also setup a physically correct colourspace and correct settings for the physical sun/sky.
Install xsiaddon from Kobayashi's Tips:http://kobayashystips.blogspot.com/2009 ... ge_21.html )
It adds a Pass > Edit > Initialise Physical sun/sky shader menu option.

1. Change the toolbar menu to Render (press 3)
2. Pass > Edit > Initialise sun shader
OR
Use Pass > Edit > Initialise Physical sun/sky shader
3. Under Sun, select the infinite light by choosing "pick" and picking it and make sure you uncheck constrain direction to world centre.
4. Press APPLY.
5. Then check through this article in regards to ensuring you have a linear colourspace working in XSI.
http://kobayashystips.blogspot.com/2009 ... image.html
You are now ready to go.
NOTE: You may notice that the sun will appear in a different place in the sky to the infinite light. This is not an error. Simply move the infinite light away from it's centre and you will find that they begin to converge after about 300 units.
--------
INTERFACE
Time:
Hours and Minutes - these convert the decimal "Localtime" into the hours minutes format we are all used to.
Localtime - This is the local time in decimal. If you need an animation of the sun going from sunrise to sunset, you will need to animate this slider (please note the ability to animate has not yet been added.)
Summertime - If you are using british summertime you will need to check this box.
Date
Day - 1-31 - Select the day of the year (please be aware that selecting the 31st of a month with less than 31 days will cause an inaccurate measurement.
Month - Select the month 1-12
Location
City - This will set the Latitude, Longitude and Timezone to that of the selected city. Approximate only. (Use Google Maps or Live maps and a to-decimal conversion to obtain an accurate position if required.)
Latitude - This is the north-south position - North is positive 0 to +90 - South is negative 0 to -90
Longitude - This is the east-west position - East is negative 0 to -180 - West is positive 0 to -180
Timezone - Select the timezone - correctly in relation to the Longitude. If you don't know it, look it up! Google will find it for you!
Timezonename - There are 30 official timezones - this is for easy reference when tweaking the timezone slider.

Debug - Turn on to get more detailed information regarding internal workings of the plugin.
Last edited by redmotion on 11 Apr 2010, 19:56, edited 3 times in total.

User avatar
redmotion
Posts: 150
Joined: 09 Jun 2009, 18:38
Location: London
Contact:

Re: Sun position plugin

Post by redmotion » 24 Sep 2009, 12:45

Sun Position plugin updated for v2010.

It has a new City pulldown menu featuring 120 cities from around the world and debug checkbox for checking calculations happening internally.

Also, using it with this sun/sky initialisation plugin: http://kobayashystips.blogspot.com/2009 ... ge_21.html and tips from this blog post is advised:
http://kobayashystips.blogspot.com/2009 ... image.html
Last edited by redmotion on 24 Sep 2009, 13:19, edited 1 time in total.

User avatar
redmotion
Posts: 150
Joined: 09 Jun 2009, 18:38
Location: London
Contact:

Re: Sun position plugin

Post by redmotion » 24 Sep 2009, 12:46

Archived info for plugins v7-7.5

--------
For info how to use, check out the video here:

http://redmotion.blogspot.com/2008_02_01_archive.html
--------

Written by Jason Wells - Redmotion <c>2007/2008/2009

Based on standard sun position algorhythms.

IF YOU USE THIS SOFTWARE, YOU AGREE TO DO IT AT YOUR OWN RISK.

--------

INSTALLATION

Place the .dll file into the \Application\Plugins folder of your user folder
(you may try the workgroup folder but it may not work)

--------

USAGE

Instructions to get the sun working:

This is a property that rotates the selected object to point towards the suns position in the sky at a specific point in time.

1. Install the plugins (put both the sun_primitive and sunposition plugins into the plugins folder - user or workgroup
2. Run the sun script. Get > Primitives > Light > Sun. It will create an infinite light attached to a null.
3. Select the null (called "centre").
4. Get > Property > Sun Position
5. A dialogue box will open.
6. Set the time and date using the sliders to position the sun.

To move the infinite light away or towards the scene centre, select the null that constrains the infinite light, go to transform mode (v) and select local transformation, or type a new figure into the transform z box.

--------

USING WITH THE V6 MENTAL RAY PHYSICAL SUN AND SKY SHADERS

1. Change the toolbar menu to Render (press 3)
2. Pass > Edit > Initialise sun shader
3. Under Sun, select the infinite light by choosing "pick" and picking it.
4. Press APPLY.

You are now ready to go.

Please note: You may notice that the sun will appear in a different place in the sky to the infinite light. This is not an error. Simply move the infinite light away from it's centre and you will find that they begin to converge after about 300 units.

--------

LIMITATIONS

- No animation - (due to my only owning XSI Foundation. The source code in C# will be made to anyone wishing to make it an operator.)
- No entry for hours and minutes in standard format.

--------

INTERFACE

Time

Hours and Minutes - these convert the decimal "Localtime" into the hours minutes format we are all used to.

Localtime - This is the local time in decimal. If you need an animation of the sun going from sunrise to sunset, you will need to animate this slider (please note the ability to animate has not yet been added.)

Summertime - If you are using british summertime you will need to check this box.

Date

Day - 1-31 - Select the day of the year (please be aware that selecting the 31st of a month with less than 31 days will cause an inaccurate measurement.

Month - Select the month 1-12

Location

Latitude - This is the north-south position - North is positive 0 to +90 - South is negative 0 to -90
Longitude - This is the east-west position - East is positive 0 to +90 - West is negative 0 to -90
Timezone - Select the timezone - correctly in relation to the Longitude. If you don't know it, look it up! Google will find it for you!
Timezonename - There are 30 official timezones - this is for easy reference when tweaking the timezone slide.

lard
Posts: 22
Joined: 09 Jun 2009, 21:57

Re: Sun position plugin

Post by lard » 23 Oct 2009, 15:40

I found the sun position tool to be very useful. However it seems the .dll needs to be updated for Soft 2010sp1 as well. Could I trouble you for an update?

User avatar
redmotion
Posts: 150
Joined: 09 Jun 2009, 18:38
Location: London
Contact:

Re: Sun position plugin

Post by redmotion » 24 Oct 2009, 11:13

Sunposition v2010_SP1.8.0.249.0.zip
(11.04 KiB) Downloaded 419 times
New compile for SP1.

Email/PM/Post here if you have any problems. Cheers.

lard
Posts: 22
Joined: 09 Jun 2009, 21:57

Re: Sun position plugin

Post by lard » 24 Oct 2009, 16:51

thanks for the update, works perfectly

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: Sun position plugin

Post by Hirazi Blue » 24 Oct 2009, 22:11

Haven't had time to check the docs yet, :!!
but has something fundamentally changed in the SP1 XSISDK again
to make such a recompile necessary?
And if so, obviously, could someone please explain what the main change(s) is/are?
Stay safe, sane & healthy!

User avatar
redmotion
Posts: 150
Joined: 09 Jun 2009, 18:38
Location: London
Contact:

Re: Sun position plugin

Post by redmotion » 24 Oct 2009, 23:54

Its because the plugin is done using C# that you need to create a new compile everytime. I may get around to making it a C++ plugin at some stage. But don't hold your breath!

Nothing in the SDK has changed to make the plugin not work, other than the version number has changed! Believe me its a pain for me too!

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: Sun position plugin

Post by Hirazi Blue » 25 Oct 2009, 09:28

Thanks for the info! :-bd
That could be considered a drawback to using C# then...
Stay safe, sane & healthy!

nassosy
Posts: 81
Joined: 02 Oct 2009, 23:50
Location: Greece
Contact:

Re: Sun position plugin

Post by nassosy » 26 Oct 2009, 11:33

Is there a chance you could compile a windows x64 version?
Thanks in advance

mtea
Posts: 25
Joined: 12 Jun 2009, 10:36

Re: Sun position plugin

Post by mtea » 26 Oct 2009, 12:57

yes this would be fine

nassosy
Posts: 81
Joined: 02 Oct 2009, 23:50
Location: Greece
Contact:

Re: Sun position plugin

Post by nassosy » 27 Oct 2009, 18:46

Or at least make the source code availliable so someone can compile it for x64 (i can)

User avatar
redmotion
Posts: 150
Joined: 09 Jun 2009, 18:38
Location: London
Contact:

Re: Sun position plugin

Post by redmotion » 06 Nov 2009, 09:29

nassosy wrote:Or at least make the source code availliable so someone can compile it for x64 (i can)
I'm pretty sure it already works on x64. I've compiled it and am running it on 64bit Windows 7. It's a C# plugin and these seem to work fine for both systems. (As far as I know. Let me know if this is not the case.)

nassosy
Posts: 81
Joined: 02 Oct 2009, 23:50
Location: Greece
Contact:

Re: Sun position plugin

Post by nassosy » 07 Nov 2009, 16:56

Sorry, my mistake.
It works in Softimage 2010 sp1 x64

lard
Posts: 22
Joined: 09 Jun 2009, 21:57

Re: Sun position plugin

Post by lard » 08 Apr 2010, 08:26

could you recompile for Soft 2011?

User avatar
redmotion
Posts: 150
Joined: 09 Jun 2009, 18:38
Location: London
Contact:

Re: Sun position plugin

Post by redmotion » 08 Apr 2010, 14:29

I may do but I'm just trying to find time to finish the ICE version (which is fully animatable). I hope to release ASAP.
http://redmotion.blogspot.com/2010/03/s ... -soon.html

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest