Balrog Posted August 12, 2015 I have searched and found nothing that answers my question. If this has been answered before, please point it out to me. I want to make a render of a Lego creation. So far, the model contains two colors. I thought about replacing the one color by random colors, but doing this by hand and brick by brick is a feasable task. it would be optimal if certain brick colors could be excluded. Is there a chance to do this in either LDD or POV-Ray? Alternatively, if this is possible with LDraw, I would give this a shot. Any ideas?? Share this post Link to post Share on other sites
Darats Posted August 12, 2015 In PovRay, the rand() function generates random numbers. You can use it in your RGB colors definitions, and you will have random colors each time you render you scene. Share this post Link to post Share on other sites
Balrog Posted August 13, 2015 (edited) In PovRay, the rand() function generates random numbers. You can use it in your RGB colors definitions, and you will have random colors each time you render you scene. So I edit the .pov file and edit the substitute color for e.g. black from a fixed value to rand()? I don't want to render a color in a single random color, but many bricks of the same color in many different colors. From what you described, it won't work the way I want it. Edited August 13, 2015 by Balrog Share this post Link to post Share on other sites
Darats Posted August 13, 2015 OK then, don't edit the color definition itself, but replace each brick color definition by a rgb value with the random values. I guess it should work. Share this post Link to post Share on other sites
Balrog Posted August 13, 2015 (edited) I'll try that when my current render is finished. update: This doesn't work. I tried replacing one of the color codes with rand(). This, of course, doesn't work. I checked the documentation and found I need to declare a seed, which I did. Still, POV-Ray gives this error: "Parse Error: Cannot assign uninitialized identifier." with highlight to the line with the rand. This would be one of the lines in the .pov file: ldd_3023(array[1]{RAND(R1)},array[1]{0},array[1][12]{{0,0,1,0,1,0,-1,0,0,-1.1999994516372681,1.5999996662139893,-4.4000000953674316}}) opposed to this: ldd_3023(array[1]{26},array[1]{0},array[1][12]{{0,0,1,0,1,0,-1,0,0,-1.9999998807907104,0.63999998569488525,-4.4000005722045898}}) Also, your first suggestion doesn't work as well, because I obviously cannot replace the RGB value by a simple rand. But it would work like this: #declare ldd_black = rgb <rand(R1)/255,rand(R2)/255,rand(R3)/255>; This is acceppted by POV-Ray, but does not result in a color change. Very strange. At this point, giving LDD2POV-Ray a certain different number to replace the Lego Black with, still results in the color not being replaced. So there is something else broken here. Edited August 13, 2015 by Balrog Share this post Link to post Share on other sites
Darats Posted August 13, 2015 #declare ldd_black = rgb <rand(R1)/255,rand(R2)/255,rand(R3)/255>; This is what I meant. I haven't really been into details but, that's what I was thinking of. A random value devided by 255 for each R, G and B color. This would work I guess, but this will give you the same random color for each black brick, try to directly implement the rgb color for each brick. I guess you are using ldd2pov, and I don't know the kind of pov file it generates so I cannot try myself. As a workround, If you where using Ldraw, I would simply write a quick code in C++ or VBA to edit the ldraw file and change randomly color values. I don't know if this would be feasable with LDd... Share this post Link to post Share on other sites