Virtual LEGO® models in LeoGEO are using a right handed system of coordinates,
(x right to the background (red), y left to the background (green)and z right up (blue))
The LeoCAD POV-Ray scene file output uses also a right handed system,
with a camera, a background and a light for a Brick_2x4
looks like this:
// File created by LeoCAD --------------//
#include "Brick_Test1.inc"
camera {
sky <0,0,1>
location <-10, -9, 6>
look_at < 0.00, 0.00, 0.00>
angle 30
}
background{ color rgb <1, 1, 1> }
light_source{<-10,-5,20> White shadowless}
object {
lg_3001
texture { lg_red }
matrix <-1.0000, 0.0000, 0.0000,
0.0000,-1.0000, 0.0000,
0.0000, 0.0000, 1.0000,
0.0000, 0.0000, 0.0000>
} // ----------------------------------//
Where the include file "Brick_Test1.inc"
essentially is containing the following 3 lines:
#include "lg_color.inc"
#include "lg_defs.inc"
#include "lg_3001.inc" |
The LeoCAD POV-Ray scene file output with some axes added for better orientation.
|
Adapting Axes: In POV-Ray normally a left handed system is used.
So we have to convert not only the camera and light but also the objects to fit correctly in
a left handed system.
Adapting Scale:
In LDraw + LeoGEO a scale of 1 unit = 10mm is used. In POV-Ray we normally use 1 unit = 1m.
So if we want to integrate virtual LEGO models in our virtual POV-Ray world we have to scale the modells
by "scale 0.01".
// LeoCAD POV-Ray Output File ---------//
// Adapted to left handed system -----//
#declare lg_quality = 4; // 0~4
#include "lg_color.inc"
#include "lg_defs.inc"
#include "lg_3001.inc" // brick 2x4
// no additional include file needed!
#declare L_Transform =
transform{ rotate<-90,-90,0> // y<->z
scale 0.01 // 1 = 1m
translate<0,0.0094,0> //up
} // end L_Transform
camera {
right x*image_width/image_height
location <-0.04, 0.05, -0.0>
look_at < 0.004, 0.00, 0.00>
angle 30
}
background{ color rgb <1, 1, 1> }
light_source{<-10,15,-20> White}
object {
lg_3001
texture { lg_red }
matrix <-1.0000, 0.0000, 0.0000,
0.0000,-1.0000, 0.0000,
0.0000, 0.0000, 1.0000,
0.0000, 0.0000, 0.0000>
transform{ L_Transform }
} // ----------------------------------//
|
The Adapted LeoCAD POV-Ray scene file output with some axes added for better orientation.
|
|