Include light source in a furniture or group light source and item

This topic has been viewed 8980 times and has 13 replies
Thread status: Active
How can I do this? [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Cactus
Posts: 13
Joined: Fri Jan 28, 2011 1:33 pm

Include light source in a furniture or group light source and item

Post by Cactus »

Hello,

I'd like to include light source in some of my furnitures.
For example I created a lamp but when I add it in my room and create a photo it does not make any light. So I added a light source inside and it's ok.

But know when I want to move my lamp I have to select the lamp + the light source.
It's not very complicated but as I have a lot of lamps and I move everything all the time, it's a bit anoying.

I'd like to group the lamp and the source into a single object.

I tried the "group" command but it does not work. I managed to do it with simple objects but it looks like it does not work with light sources.

Other solution would be to edit my .obj object but I'm not sure adding a light source in an object is as simple as adding a color or a mirror.

I found a lot of usefull information in the forum and in the documentation about lights but I didn't manage to solve this problem.
User avatar
hansmex
Posts: 4027
Joined: Sat Sep 26, 2009 11:36 am
Country: Netherlands

Re: Include light source in a furniture or group light source and item

Post by hansmex »

Cactus,

Well, it definitely works. Move the light to the side, group it, and try again.

Now, the solution to your problem. When the light bulb is hidden or obstructed by the lamp, the light can't get out. So, make sure that lamp and light don't interfere. Also, most lamp shades aren't transparent, so that too will obstruct (or at least reduce) the light getting out.

Hans
Hans

new website - under constuction
hansdirkse.info
Cactus
Posts: 13
Joined: Fri Jan 28, 2011 1:33 pm

Re: Include light source in a furniture or group light source and item

Post by Cactus »

Thanks for the quick reply.

The problem is not with the final result on the picture.
If I put my lamp with a light source inside, the result is ok and the light is fine on the final picture. Light gets out of the lamp properly.

As you told me that it's supposed to work I tried again in different ways and finaly managed to do it and found what I did wrong:
If I click the source, press shift, click the lamp and then group it works.
If I select both by clicking besides and maintain click (like drawing a square) and then group it doesn't work.
What is strange is that I don't have this problem with all the light sources.

I don't know if my explaination is very clear... but at least it finaly worked.
Thanks !
User avatar
wrosun
Posts: 96
Joined: Wed Nov 17, 2010 8:44 am
Country: Pokhara, Nepal

Re: Include light source in a furniture or group light source and item

Post by wrosun »

if you cannot select the lamp and the light source together in the 2d plan then you can use the list on the left hand side of your screen which shows which objects you have used......then you can use group furniture command or simply go with ctrl+G....
User avatar
wrosun
Posts: 96
Joined: Wed Nov 17, 2010 8:44 am
Country: Pokhara, Nepal

Re: Include light source in a furniture or group light source and item

Post by wrosun »

Correction:
sorry for the error!!
its ctrl+Shift+G
Cactus
Posts: 13
Joined: Fri Jan 28, 2011 1:33 pm

Re: Include light source in a furniture or group light source and item

Post by Cactus »

Yes I found the different ways to group objetcs.
The thing is for this special case only one way of selecting the items didn't allow me to group them.
As it was the first time I used light sources I thought it was because light sources could not be groupped but actually it has nothing to do with it.
Your way of selecting items works too, thanks.
3dfx
Posts: 9
Joined: Tue Jan 18, 2011 11:00 pm

Re: Include light source in a furniture or group light source and item

Post by 3dfx »

Some related questions:

I've created a simple model of a lamp with translucent white glass using Sketchup. The lamp is cylinder shaped with an open top. The model was then exported to .dae and imported to SH3D 3.1.

When I place a light source within the lamp the light and render a photo (at highest quality) the light only seem to escape through the top and not through the glass. The lamp model looks correct in the preview mode as shown in this screenshot: http://img143.imageshack.us/img143/1030/sh3dlightsscreenshoot.png.

Any idea what mistake I could have made?

I also have a more general question on the "customized lamps topic".. Is it possible to create custom light sources that could be included as a lights in SH3D? (I'm thinking of modeling a couple of LED spotlights so I'd like to be able to set color temperature, light distribution angle, direction as well as model the armature).
User avatar
hansmex
Posts: 4027
Joined: Sat Sep 26, 2009 11:36 am
Country: Netherlands

Re: Include light source in a furniture or group light source and item

Post by hansmex »

3dfx,

SH3D provides excellent light handling on the control and output side, but on the creation side things could do with some improvement.

To answer your first question:
1 - export your DAE lamp to OBJ format, and an OBJ and MTL file will be created;
2 - download this document that describes in some detail the properties of a MTL file;
3 - edit the MTL file with a text editor;
4 - search for the part that describes the shade and light source, then manually edit their properties and make sure there is an illum and d statement with the proper values (see page 6);
5 - hope that this solves your problem.

The solution to your second question will probably involve programming a plug-in or extension that will allow you to set those variables. The SH3D source code is available on SourceForge, but as I cannot program, I wouldn't know exactly where to find it.

Hans
Hans

new website - under constuction
hansdirkse.info
3dfx
Posts: 9
Joined: Tue Jan 18, 2011 11:00 pm

Re: Include light source in a furniture or group light source and item

Post by 3dfx »

Thank you Hans!

I exported the sketchup model to obj using TIGs OBJExporter script.

The default material definition was:
newmtl Translucent_Glass_White15
Ka 0.000000 0.000000 0.000000
Kd 0.996078 0.996078 0.976471
Ks 0.000000 0.000000 0.000000
d 0.750000
map_Kd my-cylinder-lamp_Textures/Translucent_Glass_White15.jpg

I tried to change the values but could not get the effect that I'm looking for (frosted white glass). With the map_Kd param I have no transparency in the result Create Photo dialog.

If I remove the map_Kd param and add some Illum I get a colorless translucent shape from Create Photo.

The strange thing is that the preview seems to handle the settings better, e.g if I set Ks 0.000000 1.000000 0.000000 I get a translucent green lamp in the preview whereas the rendered photo only gets color reflected upon it.
User avatar
hansmex
Posts: 4027
Joined: Sat Sep 26, 2009 11:36 am
Country: Netherlands

Re: Include light source in a furniture or group light source and item

Post by hansmex »

3dfx,

The fact that I assembled the OBJ properties document doesn't mean that I understand how to use it... I've dabbled a bit with it, but the best (and only) thing I managed to do was making an object invisible. After that my curiosity disappeared...

Hans
Hans

new website - under constuction
hansdirkse.info
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 2 guests