Problems creating a light

This topic has been viewed 7488 times and has 9 replies
Thread status: Active
Looking for a particular 3D model or texture? [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Post Reply New Topic
seabird
Posts: 6
Joined: Mon Jul 21, 2014 10:41 pm

Problems creating a light

Post by seabird »

Hi everybody,

recently switched to SH3D and am exploring the options and impressed with options and configuration. The one thing I am having problems with is creating a functional lamp/light.

I created my home/kitchen light Image

The problem is when I insert light sources I do not get the same "lightbulb". That distinct light inside glas spot is missing (hard to explain I guess)

Also, I create the lamp itself in Blender, and edited the material after export for transparency. But is there a way to make the object a Light? Should I do this in Blender?
okh
Posts: 1545
Joined: Sun May 12, 2013 9:43 pm

Re: Problems creating a light

Post by okh »

Nice lamp. Yes, you can add light sources to your models, but .obj format does not support lights (unless I missed something). However, if you use the Furniture Library Editor and import your model, you can manually add properties for sh3d models - including lights.

There are threads on this if you search and more info in the Source Forge documentation. I hope you will share your model. Good luck.

ok


PS: I never find posts when I need them, so I added a little memo in the SVG manual on page 9 and 10 More editing: PluginFurnitureCatalog.properties.
seabird
Posts: 6
Joined: Mon Jul 21, 2014 10:41 pm

Re: Problems creating a light

Post by seabird »

cool, must have overlooked that in the repositories. Still needs a manual edit, but that's ok. Any handy tools to calculate the X,Y,Z, coordinates?
seabird
Posts: 6
Joined: Mon Jul 21, 2014 10:41 pm

Re: Problems creating a light

Post by seabird »

And for now I edited the material with D 0.50000 for a glas (see through) look. Or are there better ways for that?
okh
Posts: 1545
Joined: Sun May 12, 2013 9:43 pm

Re: Problems creating a light

Post by okh »

D 0.5 sounds about right for a glazed bulb, but you can play with textures (semi transparent) and light colour too...

I find it easier to import the model to SH3D and re-export after having set the correct dimensions (this depends very much on the model software used). With rotation and dimensions present, I guesstimate the x, y, z co-ordinates for the light. Obviously, if you have the correct (absolutish) values in Blender, you can also use Blender to measure exactly.

I forgot to mention (in the SVG guide) that you can add several light sources to one object. More about that in the repositories, as you appear to be more than able to figure it out on your own [:)] - good luck, and it would be fun to see the result.

ok
seabird
Posts: 6
Joined: Mon Jul 21, 2014 10:41 pm

Re: Problems creating a light

Post by seabird »

Yes, I figured it out mostly. Once the dimension is set (120cm) the coordinates are centimeter based. I added several lights and played with the MTL file.

Code: Select all

name#2=Lamp onderdelen 
category#2=Lights 
icon#2=/Lamp onderdelen.png 
model#2=/Lamp onderdelen/lamp%20onderdelen.obj 
multiPartModel#2=true 
width#2=120 
depth#2=10.9091 
height#2=562.14746 
movable#2=true 
doorOrWindow#2=false 
lightSourceX#2=5 32.5 60 87.5 115 
lightSourceY#2=5.5 5.5 5.5 5.5 5.5 
lightSourceZ#2=3 3 3 3 3 
lightSourceColor#2=#ffffff #ffffff #ffffff #ffffff #ffffff lightSourceDiameter#2=1 1 1 1 1 
elevation#2=140 
creator#2=Jacco
MTL:

Code: Select all

# 3D model lamp onderdelen.obj  
newmtl Brushed_metal 
illum 2 
Ka 0.0 0.0 0.0 
Kd 0.168542 0.166863 0.166863 
Ks 1.680151 1.680151 1.680151 
Ns 128.0 Ni 1.0  

newmtl Mat_Glas 
Ka 1.0000 1.0000 1.0000 
Kd 1.0000 1.0000 1.0000 
Ks 1.0000 1.0000 1.0000 
Tf 1.0000 1.0000 1.0000 
Ns 200 Ni 1.2000 
illum 7 
d 0.94  

newmtl Helder_glas 
Ka 0.0000 0.0000 0.0000 
Kd 0.0000 0.0000 0.0000 
Ks 0.9000 0.9000 0.9000 
Tf 1.0000 1.0000 1.0000 
Ns 200 Ni 1.2000 
illum 6 
d 0.3
After I manually changed the glass color to almost white in sh3d.

result so far (light is at 3% and a ambient light behind me to light the metal)
(still not the matt glass I want on top and still missing the "light source/bulb")
The light also needs to become "smoother".
Image
okh
Posts: 1545
Joined: Sun May 12, 2013 9:43 pm

Re: Problems creating a light

Post by okh »

Looks like you're doing very well. Doesn't #ffffff render too white? ok
seabird
Posts: 6
Joined: Mon Jul 21, 2014 10:41 pm

Re: Problems creating a light

Post by seabird »

Thank you.

Most of it is moddeling in Blender too be honest (glad it is a easy shaped light).

Glass material seems to be a problem in sh3d.

to do:
-Make the top frosted
-Have a lightbulb that lights up
-Create a smoother render (more detailed boxes in blender?)
seabird
Posts: 6
Joined: Mon Jul 21, 2014 10:41 pm

Re: Problems creating a light

Post by seabird »

Ok, the frosting needs more fine tuning (help is appreciated), but the better models from blender did help.

Code: Select all

newmtl Mat_Glas 
Ka 1.0000 1.0000 1.0000 
Kd 1.0000 1.0000 1.0000 
Ks 1.0000 1.0000 1.0000 
Tf 1.0000 1.0000 1.0000 
Ns 40 
Ni 0.4000 
illum 9 
d 0.90

Image

The main thing missing now is a lightbulb (not so much the shape but the effect of the light origin. Any tips?
okh
Posts: 1545
Joined: Sun May 12, 2013 9:43 pm

Re: Problems creating a light

Post by okh »

Did you try making a sphere (bulb) with white-ish, semi-transparent texture (png with alpha channel / transparency, in stead of or in addition to transparency in the .mtl file)? ok
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest