Cheetah3D User Forum  


Reply
 
Thread Tools Search this Thread Display Modes
Old
  (#1)
ToddWR (Offline)
Erfahrener Benutzer
Site Admin
 
ToddWR's Avatar
 
Posts: 188
Join Date: 24.02.2006
Cool Let the sun shine in... - 19.12.2006, 04:21

everyone,

here is the first drift of a script to position a light source just like it was the sun. this is a tools folder script. After martin makes an improvement to the script tags, I will redo this to be a tag for a light source

have fun

Todd
Attached Files
File Type: zip theSun.zip (11.6 KB, 282 views)

Last edited by ToddWR : 19.12.2006 at 22:20. Reason: changed the file to the new version
   
Reply With Quote
Old
  (#2)
peer (Offline)
Erfahrener Benutzer
Site Admin
 
peer's Avatar
 
Posts: 811
Join Date: 07.04.2005
Location: Rotterdam, the Netherlands
Default 19.12.2006, 09:09

Hi Todd, nice tool!
One thing though. Maybe this has something to do with the twilightzone, but when I enter the following settings, I get the "below the horizon" warning. The settings are for Rotterdam on july 29 2006 at 11 in the morning.

Regards,

Peter

Edit: maybe you can have settings for East/West and North/South?
If you made the script for American users you get different results compared to europe or australia I think.
Attached Images
 


Mac Pro Quad 3.0 GHz 2 GB Ram, Intel dualcore iMac 2.0 GHz 1.5 GB Ram, OS X 10.6.2, Sketchup 7.1 Pro, Vectorworks 2009 Architect, CHEETAH3D 5.0.1, Photoshop CS4.

Last edited by peer : 19.12.2006 at 09:12.
   
Reply With Quote
Old
  (#3)
ToddWR (Offline)
Erfahrener Benutzer
Site Admin
 
ToddWR's Avatar
 
Posts: 188
Join Date: 24.02.2006
Default 19.12.2006, 22:19

peer,

thanks, I looked into it with a fresh head and found the problem. Plus I added a bonus, see if you can see what it is.
latitude is positive to the NORTH, and longitude is positive to the WEST of the prime meridian, negitive values are to the SOUTH and EAST.

Todd
Attached Files
File Type: zip theSun.zip (11.6 KB, 297 views)
   
Reply With Quote
Old
  (#4)
peer (Offline)
Erfahrener Benutzer
Site Admin
 
peer's Avatar
 
Posts: 811
Join Date: 07.04.2005
Location: Rotterdam, the Netherlands
Default 20.12.2006, 09:21

Thanks for updating the script. I could find the bonus inside Cheetah, but when I looked through the code I saw some cities with coordinates. Is this the bonus? Does the script also change the angle of a distant light? I couldn't make that up in the script (I'm a complete beginner at scripting).
I made a solar animation from 6 in the morning to 6 in the evening. I only had to set an extra key on the 12 o'clock position of the light. This is very nice!!

Regards,
Peter
Attached Files
File Type: zip Sun.zip (163.2 KB, 305 views)


Mac Pro Quad 3.0 GHz 2 GB Ram, Intel dualcore iMac 2.0 GHz 1.5 GB Ram, OS X 10.6.2, Sketchup 7.1 Pro, Vectorworks 2009 Architect, CHEETAH3D 5.0.1, Photoshop CS4.
   
Reply With Quote
Old
  (#5)
Martin (Offline)
Erfahrener Benutzer
Site Admin
 
Martin's Avatar
 
Posts: 4,087
Join Date: 13.03.2005
Default 21.12.2006, 01:56

Hi Todd,
very useful script. I was ask quite some times for such a function. Now you took the work from me. Thanks.

Bye,
Martin
   
Reply With Quote
Old
  (#6)
ToddWR (Offline)
Erfahrener Benutzer
Site Admin
 
ToddWR's Avatar
 
Posts: 188
Join Date: 24.02.2006
Default 21.12.2006, 04:06

Martin,
I would rather have this as a 'Tag' script instead of a tool script, so the sun could animated in an easier way.

speaking of requested features.... any that might be implimented as a script? I am always looking for things to do instead of modeling... just an idea

Todd

P.s.

for any that desire for the sun (read area light) to point at the origin (0,0,0) look for the following line in the makeIt function:
Code:
obj.setParameter("position",pos);

add the following line after it and BINGO, the light source points at (0,0,0)
Code:
obj.setParameter("rotation",new Vec3D(-ang.x-north,0,ang.y + 90));

happy modeling
Todd

p.p.s

the hidden bonus is that the entries are saved to a file and reloaded when the script is loaded next time.
martin, I created a cheetah3d folder at /Library/Application Support/Cheetah3D in order to save any prefs of my scripts... hope that is ok
   
Reply With Quote
Old
  (#7)
peer (Offline)
Erfahrener Benutzer
Site Admin
 
peer's Avatar
 
Posts: 811
Join Date: 07.04.2005
Location: Rotterdam, the Netherlands
Default 21.12.2006, 07:31

Hi Todd,

The script works great with the added line of code! This is a great tool. Indeed it would be nice if you could turn it into a tag.

Regards,

Peter


Mac Pro Quad 3.0 GHz 2 GB Ram, Intel dualcore iMac 2.0 GHz 1.5 GB Ram, OS X 10.6.2, Sketchup 7.1 Pro, Vectorworks 2009 Architect, CHEETAH3D 5.0.1, Photoshop CS4.
   
Reply With Quote
Old
  (#8)
tg_jp (Offline)
Erfahrener Benutzer
Site Admin
 
Posts: 538
Join Date: 09.04.2005
Default 21.12.2006, 14:52

Hello, Tod.

great script!! works fine.

and your idea about script's prefs is useful. Possibly may need some guidelines about preferences file folder of scripts in the future.

by the way, the lights is headed to -Y by default.
So the code for rotation wiil be

Code:
obj.setParameter("rotation",new Vec3D(-ang.x-north,0,ang.y - 90));

regards.

Hiroto, tg_jp
   
Reply With Quote
Old
  (#9)
ToddWR (Offline)
Erfahrener Benutzer
Site Admin
 
ToddWR's Avatar
 
Posts: 188
Join Date: 24.02.2006
Default 21.12.2006, 19:15

Hiroto,

thanks for that correction, it seems like I am always having problems with changing the sign of the answer lol


Todd
   
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



Powered by vBulletin Version 3.6.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com