C3POwen

[Guide] Rendering LDraw models using POV-Ray

Recommended Posts

I was working on the Covered Wagon set but when I open it in LDView it gives me a list of errors and doesn't show the cover of the wagon. In POV-Ray it renders the model without it. Is there a way I can get it to be visible in LDView and in the render?

I suppose the first thing to ask is where is the LDraw part for the wagon cover stored? Is it stored in the standard LDraw parts folder?

Share this post


Link to post
Share on other sites

I suppose you built the set in SR3D Builder? Do LDview and SR3D use the same LDraw directory?

Share this post


Link to post
Share on other sites

Yes, they do.

I was actually able to sort it out this afternoon. Not exactly sure what I did, but it works now. :classic:

Share this post


Link to post
Share on other sites

I was actually able to sort it out this afternoon. Not exactly sure what I did, but it works now. :classic:

How odd! LDView shouldn't have any issues loading parts and converting them to POV-Ray if looking at the right LDraw path.

On an unrelated note, I'm in the midst of some new LGEO parts, and thought that a couple of them might interest you, considering some of the sets you've built in LDraw in the past...

LGEO%20Cannon.png

The cannon base and cannon barrel are both new, and will be released once I'm done with a number of Technic pneumatic parts (which was requested here).

Share this post


Link to post
Share on other sites

How odd! LDView shouldn't have any issues loading parts and converting them to POV-Ray if looking at the right LDraw path.

Oddly, when I'm looking at the model with the covered wagon in LDView it always gives me a crash notice when I exit the programme. Weird!

On an unrelated note, I'm in the midst of some new LGEO parts, and thought that a couple of them might interest you, considering some of the sets you've built in LDraw in the past...

:wub: Thank you!

Share this post


Link to post
Share on other sites

Okay, for the record I do most of my work in SR 3D Builder and then sometimes add some things in MLCad for the parts that don't snap well, etc. As it turns out, when I place the Canvas Covered Wagon part in the model in SR 3D Builder, it gives me errors in the other two. When I place it in the model in MLCad, it works fine. I still don't understand the problem as the part number is the same for the part in MLCad and SR 3D Builder, and only one .dat file exits in the LDraw installation folder, so it's most strange. Neither of you have this problem I'm guessing, right?

Share this post


Link to post
Share on other sites

GUIDE UPDATE: I have updated the LGEO-Update.zip file in the Downloads section with 30 new parts, 4 updated parts (only 3 shown) and 3 fixed parts.

LGEO%202014-01-16.png

The FIXED, UPDATED and NEW LGEO parts from the 2014-01-16 update

This update does a couple of things. It addresses some issues that LDView has when generating the POV-Ray code for the two Technic gears above. It also adds a fair few pneumatic parts, more of which I will be working on.

The parts I'm most pleased with are the cannon barrel and cannon base - the barrel was built in a way in LDraw that meant that it never translated well to POV-Ray, always looking more octagonal than round, so should look a bit better now!

Share this post


Link to post
Share on other sites

Can't wait to re-render all of those Pirate sets with the new cannon. It's come just in time for the Western ones though. :sweet:

Share this post


Link to post
Share on other sites

So I've been playing around with something that hasn't been mentiones yet in this thread - glowing bricks used to light the scene.

I took this WIP model of a fire engine and placed spotlights inside all the transparent bricks. The light emitted from the brick will filtered by the color of the brick, giving the light just the right color.

I also found that placing bright lights with high "fade_power" and small "fade_distance" values inside the bricks will help to make the brick appear to glow without washing out the light of the surrounding area.

Has anyone else tried something similar?

Hi Nickless, I also tried to enlighten virtual lego models by positioning light sources insight transparent bricks or by similar measures.

Please have a look to http://sr3d.spooncla....php?f=13&t=705 or http://www.flickr.co.../107790234@N02/

... and sorry for my late reply to your post.

regards

papacharly

Share this post


Link to post
Share on other sites

Thanks for the links, it also interested me.

I've tried this code:

light_source {

<-6.0000004768371582,2.4800024032592773,-3.9999995231628418>

color rgb <1,1,1>*intensity 1

fade_distance 10

fade_power 3

}

It seems there is an error. Could someone help me please ?

Other question : how can I find the coordinates of the concerned bricks ?

Share this post


Link to post
Share on other sites

light_source {

<-6.0000004768371582,2.4800024032592773,-3.9999995231628418>

color rgb <1,1,1>*intensity 1

fade_distance 10

fade_power 3

}

It seems there is an error. Could someone help me please ?

Other question : how can I find the coordinates of the concerned bricks ?

“intensity 1” is just a variable or a placeholder for an arbitrary value for adjusting the brightness (intensity ) of this light source. The most easy way is to replace it by an integer (e.g.color rgb <1,1,1>*3). If “3” is too much bright then go e.g. for *1 or *0.5. Just play around with this value for getting the effect you wish to have. In the same way you have to play around with the fade distance and fade power values.

I only use SR3D: For SR3D you just need to position the cursor on the concerned brick and click it. The coordinates will be displayed at the bottom of the GUI.

regards

papacharly

Share this post


Link to post
Share on other sites

Sorry for the double post.

I've made some tests for the light source and it seems to work. Thanks again !

I've had an other idea: would it be possible to add an incandescent aura around a transparent part. In fact, it would be to improve the lightsaber's blade effect.

I've found this code on a POV-Ray Tuto (here), but I was not able to make it work:

pigment{ color Clear } or

pigment{ color rgbf<1,1,1,1>}

#declare Blade_Center =

object{

Round_Cylinder(<0,0,0>,<0,1,0>,

0.02, 0.01, 1)

pigment{ color rgbf<1,1,1,1>}

// the container should be clear

hollow

interior{

media{

emission <1.0,0.1,0.5>*7

} // end media

} // end interior

} // end object

//----------------------------------------

union{

light_source{<0, 0, 0>

color rgb <0.5,0.0,0.3>*0.75

area_light

<0, 0.1, 0> <0, 0.9, 0> //

1, 5 //

} //---------------------------

object{ Blade_Center }

//----------------------------------

object{ Blade_Aura }

//----------------------------------

// + handle see scene description !

}// end of union ---------------------------

Share this post


Link to post
Share on other sites

Hi Courleciel,

please find here (http://bricksafe.com...charly/test.pov) a complete povray-file (3.7) which I set up especially for you. :wink:

Basic scene:

test1.jpg

Scene with enlighted brick, inner aura and outer aura:

test2.jpg

Not sure, if this is the effect you wish to achieve. However, what you see is more or less the result of copying the scene file out of the POV-Ray Tuto and applying it to the basic scene above.

Now it's up to you to tweak it to suit your needs. I would highly appreciate to see the results of your project here.

…. and may the force be with you.

regards

papacharly

Share this post


Link to post
Share on other sites

So, I just installed another hard drive into my desktop and I wanted to run a POV-Ray render to the new drive by adding the "Output_File_Name=..." to the Master POVRay.ini file. However, I got a "IO restrictions prohibit write access to ..." error. I removed the restrictions and tried again, but then I got the error "Cannot create render state output file." Any idea what the problem could be? I get the impression that it's something simple, but I get this error whenever I try to change the directory of the render from the directory of the .pov file.

Edited by Palathadric

Share this post


Link to post
Share on other sites

Thanks again for your help papacharly.

I've tried to apply your code on my pov ray file. Ouah, that's not easy ! :wacko:

Here is the result (after many attempts):

post-1256-0-23193900-1390655333_thumb.png

But I still have some issues:

- the aura's color

- the light's reflection: is there a way to remove the reflection only for the enlightened parts ?

- the coordinates. It seems they are of its type : x1,y1,z1,x2,y2xz2,x3,y3,z3,x4,y4,z4. But what are these points ? The center of the part, the point of contact, the extremity points ?...

I've added this:

// Brick Light

light_source {<-0.72383087873458862,2.9674797058105469,1.5550704002380371> color rgb <1,1,1>*50 }

// outer aura

#declare outer_aura =

object{

Round_Cylinder(<-0.72383087873458862,2.9674797058105469,1.5550704002380371>,<-0.25881800055503845,-0.9512515664100647,0.16773106157779694>,0.3, 1, 1)

pigment{ color rgbf<1,1,1,1>/2}

hollow

interior{

media{

emission <1.42,1.0,1.12>

}}}

union{

light_source{<-0.72383087873458862,2.9674797058105469,1.5550704002380371>

color rgb <1.42,1.0,1.12>*0.75

area_light

<0, 6, 0> <0, 28, 0>

1, 5

}

object{ outer_aura }

}

And here is the line code of the concerned part:

ldd_30374(array[1]{42},array[1]{0},array[1][12]

{{0.96566987037658691,-0.25881797075271606,0.022248197346925735,0.022248188033699989,0.16773106157779694,0.98558169603347778,

-0.25881800055503845,-0.9512515664100647,0.16773106157779694,-0.72383087873458862,2.9674797058105469,1.5550704002380371}})

Edited by Courleciel

Share this post


Link to post
Share on other sites

Hi Courleciel,

it seems that you are using LDD? I am not familiar with this. So regarding the coordinates I cant give a hint. Maybe somebody else can do?

Regarding the auras color I have added some comments to the povray-file (http://bricksafe.com..._Lightsabre.pov): Have a look to the light sabre part at the end of the file. BTW: I suppressed the sabre part 30374.

So the light sabre scene is:

DarthVader_Lightsabre.jpg

Could you please specify your “reflection-question” ? Je pédale dans la choucroute!

Hope, its now easier for you to go ahead.

… and never give up (reading some more povray tutorials :sweet: ).

regards

papacharly

Share this post


Link to post
Share on other sites

Hi,

Thanks. Your scene is exactly what I'm trying to do !

Indeed, I'm using LDD. So it's still difficult to place the auras since the coordinates seem to be very different between the two softwares...

Concerning the reflection. Well, I've created some light sources on many parts (which are very close), and it has given a big flash on the floor. Consequently, I was wondering if there is a simple way to remove this light reflection (only for the enlightened bricks, I would like to keep the reflection and the shadow for the other parts with no light source).

Edited by Courleciel

Share this post


Link to post
Share on other sites

Hi,

Many thanks for your help. I'm really sorry, I do my best to understand how to resolve this problem...

I've tried to illustrate my problem as you've done previously:

post-1256-0-39258600-1390828115_thumb.jpg

I've though it would remove these undesirable areas. In other ways, I would like to keep the light source inside the center of the parts.

As you advised me, I've changed the fade_distance and the fade_power. Even though they are both equal to 0, it still gives reflections.

light_source {

<-5.1999988555908203,1.8400000333786011,4.1600008010864258>

color rgb <1,1,1>*5

fade_distance 0

fade_power 0

}

I've also tried this:

light_source {

<-5.1999988555908203,1.8400000333786011,4.1600008010864258>

color rgb <1,1,1>*5

spotlight point_at <-5.1999988555908203,1.8400000333786011,4.1600008010864258>

fade_distance 0

fade_power 0

}

But it seems it cancels the initial light_source effect.

Edited by Courleciel

Share this post


Link to post
Share on other sites

Setting fade power = 0 is not the best choice. You have to understand fade power as a "damping factor". So the higher fade power is, the less bright the light gets. So go for fade power = 5 or 10 and see what is happening.

Fade distance = distance of full light intensity: So only light which is travelling further than "fade distance" is getting damped.

As the length of a brick 1x1 is 20 (for Ldraw parts), so fade distance should be > 10. Otherwise it might happen that the light wont emerge out of the brick at all.

If you cant resolve the problem so feel free to send me your complete pov-file and I will try to fix the problem.

Share this post


Link to post
Share on other sites

I didn't see this in any previous post (though I might have overlooked it), but version 3.7 of POV-Ray changed the way it handles transparent backgrounds.

In previous versions, all you needed to do was type +UA in the little window next to the picture size.

In version 3.7, you also need to modify your Background line to something like this:

background { color rgbft <LDXBgR,LDXBgG,LDXBgB,0,1> }

The first three components are the RGB colors for the background. The 0 after the colors is the Filter component. I haven't tried messing with it to see what it does. The final number in the vector is the Transmit component, and setting it to 1 allows all light to transmit through the background, hence making it transparent.

Share this post


Link to post
Share on other sites

I don't know. The +UA works fine for me and I'm using POV-Ray 3.7 RC6.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.