Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 5
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 58894 times and has 4 replies Next Thread
fma
Member




Joined: Mar 15, 2010
Post Count: 62
Status: Offline
Reply to this Post  Reply with Quote 
Simulate sun position and lights/shadows

Hi,

We are currently designing our futur house, and would like to optimize the windows position and size.

I'm new to SweetHome3D, and I would like to know if it is possible to simulate the sun position, according to the date and time, and have the lights/shadows visible in the house? Is it possible to implement such feature through the plugins mecanism?

Another way could be to design the house in SweetHome3D, export it, re-import it in Blender, and write a script for Blender (as I'm a python developer, this last step would be easier for me, but I don't know if the export/import step is easy or not).

Note that we don't need a very high level of details, but only the volumes of the room and furnitures...

Thanks for any suggestion!
----------------------------------------
Frédéric
[Mar 15, 2010, 8:22:43 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
fma
Member




Joined: Mar 15, 2010
Post Count: 62
Status: Offline
Reply to this Post  Reply with Quote 
Re: Simulate sun position and lights/shadows

Playing with SH3D, I found it automatically adds several lights to illuminate the scene.

Is there a way to manage these lights through a plugin, before rendering?
----------------------------------------
Frédéric
[Mar 15, 2010, 6:52:39 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: Simulate sun position and lights/shadows

is it possible to simulate the sun position, according to the date and time, and have the lights/shadows visible in the house?

No yet

Is it possible to implement such feature through the plugins mecanism?

You could create a plugin based on the existing PhotoPanel and PhotoRenderer classes, then change the sundir direction depending on your wish. If you want to see where will go the sun through window panes, you should also modify PhotoRenderer class in such a way it doesn't create any SunFlow object for panes because SunFlow isn't able to compute light going through panes yet.
This can be achieved easily. At line 313, replace:

if (appearance != null) {
texCoordGeneration = appearance.getTexCoordGeneration();
appearanceName = "shader" + uuid;
boolean mirror = shapeName != null
&& shapeName.startsWith(ModelManager.MIRROR_SHAPE_PREFIX);
exportAppearance(appearance, appearanceName, mirror, noConstantShader);
}

by :

if (appearance != null) {
if (shapeName != null
&& shapeName.startsWith(ModelManager.WINDOW_PANE_SHAPE_PREFIX)
&& isDoorOrWindowChild(shape)) {
return;
}
texCoordGeneration = appearance.getTexCoordGeneration();
appearanceName = "shader" + uuid;
boolean mirror = shapeName != null
&& shapeName.startsWith(ModelManager.MIRROR_SHAPE_PREFIX);
exportAppearance(appearance, appearanceName, mirror, noConstantShader);
}

and add the following method:

/**
* Returns <code>true</code> if the given <code>node</code>
* is a part of a door or a window.
*/
private boolean isDoorOrWindowChild(Node node) {
Object userData = node.getUserData();
if (userData instanceof HomePieceOfFurniture) {
return ((HomePieceOfFurniture)userData).isDoorOrWindow();
} else {
Node parent = node.getParent();
if (parent != null) {
return isDoorOrWindowChild(parent);
} else {
return false;
}
}
}



Another way could be to design the house in SweetHome3D, export it, re-import it in Blender, and write a script for Blender (as I'm a python developer, this last step would be easier for me, but I don't know if the export/import step is easy or not).

Importing to Blender a home exported with 3D view > Export to 3D view menu item works well too.
Have a look to user's guide for an example. wink
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Mar 15, 2010, 6:55:51 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
fma
Member




Joined: Mar 15, 2010
Post Count: 62
Status: Offline
Reply to this Post  Reply with Quote 
Re: Simulate sun position and lights/shadows

Thanks for your answer. I think I will switch to the french part of the forum to ask you more questions about this plugin...
----------------------------------------
Frédéric
[Mar 15, 2010, 7:59:37 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
fma
Member




Joined: Mar 15, 2010
Post Count: 62
Status: Offline
Reply to this Post  Reply with Quote 
Re: Simulate sun position and lights/shadows

The french post is here...
----------------------------------------
Frédéric
[Mar 15, 2010, 8:21:04 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved