Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
LEGO in POV-Ray

     Virtual LEGO® Models from CAD Programs in POV-Ray
Rendering of virtual LEGO® models from CAD programs
like LDraw™ and LeoGEO or LEGO Digital Designer® in POV-Ray

Français français
Italiano Italiano
Deutsch Deutsch

Home
- POV-Ray Tutorial
 
LEGO ® and POV-Ray
   Content
CAD for LEGO ®
  - LEGO Digital Designer®
  - LDraw ™
  - LDraw + LeoCAD
  - LDraw + MLCad

CAD to POV-Ray
  - LeoCAD to POV-Ray
  - Axes + Scales
  - Adapted Colors
  ->LGeo POV-Ray Objects

  - LEGO Model Sizes + Grid

                                       

LGEO POV-Ray Objects
Virtual LEGO® elements for the use in POV-Ray

For using LGEO elements as independent POV-Ray objects we have to do the following:
1) Be sure that you have add in POVRAY.INI:
    Library_Path="C:\LDraw\Apps\LGEO\lg"
2) Find the number of the brick you want to use in POV-Ray.
    Start LeoGeo, choose the wanted brick, insert it and have a look at the status bar of LeoCAD
    (if there is no status bar at the bottom of the window, activate it in "View").
    For some more complex kind of bricks you should run the POV-Ray output of LeoCAD,
    to see which components are needed!
3) Add to your POV-Ray scene file:

#declare L_Transform =
 transform{ scale<-1,-1,1>
            rotate<-90,-90,0> // y<->z
            scale 0.01       // 1 = 1m
            translate<0,0.0094,0> //up on the floor
          } // end L_Transform
#declare Raster_Width  = 0.008;  // 8 mm
#declare Raster_Height = 0.0096; // 9.6 mm
#include "lg_color2.inc"
#include "lg_defs.inc"
#include "lg_BRICK_NUMBER.inc" 
Where BRICK_NUMBER is the number of the brick to use. I.e.:
#include "lg_3001.inc" // for a brick_2x4
#include "lg_4286.inc" // for a slope brick_33_3x1

4) Insert the bricks in scene:
object {
 lg_3001
 texture { lg_red }
 transform{ L_Transform }
} // end 3001

object {
 merge {
 object {
  lg_4286
  texture { lg_yellow }
  }
 object {
  lg_4286_slope
  texture { lg_yellow
            normal { bumps 0.3 scale 0.02 } }
 }
 transform{ L_Transform }
 translate<1.5*Raster_Width,
               1*Raster_Height,
                0.5*Raster_Width>
} // end 4286
 
Brick_2x4 = lg_3001

Slope_Brick_33_3x1 = lg_4268

Brick_2x4 + Slope_Brick_33_3x1 = lg_3001 + lg_4268



© Friedrich A. Lohmüller, 2009
email email: (legacy email redacted)
www.f-lohmueller.de

 LEGO ® is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this site.
LEGO has its own homepage:
www.lego.com, and a page on the Mindstorms system: mindstorms.lego.com