Skip to content
Snippets Groups Projects
Commit 9da8924e authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

- enable lights by default
- remove obsolete comments about MergeWithBoundingBox
parent 9905ea58
Branches
Tags
No related merge requests found
...@@ -468,9 +468,9 @@ StringXNumber GeneralOptions_Number[] = { ...@@ -468,9 +468,9 @@ StringXNumber GeneralOptions_Number[] = {
{ F|O, "Light0" , opt_general_light0 , 1. , { F|O, "Light0" , opt_general_light0 , 1. ,
"Enable light source 0" }, "Enable light source 0" },
{ F|O, "Light0X" , opt_general_light00 , 0.5 , { F|O, "Light0X" , opt_general_light00 , 0.65 ,
"X position of light source 0" }, "X position of light source 0" },
{ F|O, "Light0Y" , opt_general_light01 , 0.3 , { F|O, "Light0Y" , opt_general_light01 , 0.65 ,
"Y position of light source 0" }, "Y position of light source 0" },
{ F|O, "Light0Z" , opt_general_light02 , 1.0 , { F|O, "Light0Z" , opt_general_light02 , 1.0 ,
"Z position of light source 0" }, "Z position of light source 0" },
...@@ -647,7 +647,7 @@ StringXNumber GeometryOptions_Number[] = { ...@@ -647,7 +647,7 @@ StringXNumber GeometryOptions_Number[] = {
{ F|O, "Highlight" , opt_geometry_highlight , 1. , { F|O, "Highlight" , opt_geometry_highlight , 1. ,
"Not used" }, "Not used" },
{ F|O, "Light" , opt_geometry_light , 0. , { F|O, "Light" , opt_geometry_light , 1. ,
"Enable lighting for the geometry" }, "Enable lighting for the geometry" },
{ F|O, "Lines" , opt_geometry_lines , 1. , { F|O, "Lines" , opt_geometry_lines , 1. ,
"Display geometry curves?" }, "Display geometry curves?" },
...@@ -751,7 +751,7 @@ StringXNumber MeshOptions_Number[] = { ...@@ -751,7 +751,7 @@ StringXNumber MeshOptions_Number[] = {
{ F|O, "Interactive" , opt_mesh_interactive , 0. , { F|O, "Interactive" , opt_mesh_interactive , 0. ,
"Show the construction of the 2D mesh in real time (only with the 2D anisotropic algorithm)" }, "Show the construction of the 2D mesh in real time (only with the 2D anisotropic algorithm)" },
{ F|O, "Light" , opt_mesh_light , 0. , { F|O, "Light" , opt_mesh_light , 1. ,
"Enable lighting for the mesh" }, "Enable lighting for the mesh" },
{ F|O, "Lines" , opt_mesh_lines , 0. , { F|O, "Lines" , opt_mesh_lines , 0. ,
"Display mesh lines (1D elements)?" }, "Display mesh lines (1D elements)?" },
...@@ -903,7 +903,7 @@ StringXNumber PostProcessingOptions_Number[] = { ...@@ -903,7 +903,7 @@ StringXNumber PostProcessingOptions_Number[] = {
StringXNumber ViewOptions_Number[] = { StringXNumber ViewOptions_Number[] = {
{ F|O, "AlphaChannel" , opt_view_alpha_channel , 1.0 , { F|O, "AlphaChannel" , opt_view_alpha_channel , 1.0 ,
"Global alpha channel value (used only if != 1)" }, "Global alpha channel value (used only if != 1)" },
{ F|O, "AngleSmoothNormals" , opt_view_angle_smooth_normals , 15. , { F|O, "AngleSmoothNormals" , opt_view_angle_smooth_normals , 180. ,
"Threshold angle below which normals are not smoothed" }, "Threshold angle below which normals are not smoothed" },
{ F|O, "ArrowHeadRadius" , opt_view_arrow_head_radius , 0.12 , { F|O, "ArrowHeadRadius" , opt_view_arrow_head_radius , 0.12 ,
"Relative radius of arrow head" }, "Relative radius of arrow head" },
...@@ -965,7 +965,7 @@ StringXNumber ViewOptions_Number[] = { ...@@ -965,7 +965,7 @@ StringXNumber ViewOptions_Number[] = {
{ F|O, "IntervalsType" , opt_view_intervals_type , DRAW_POST_CONTINUOUS , { F|O, "IntervalsType" , opt_view_intervals_type , DRAW_POST_CONTINUOUS ,
"Type of interval display (1=iso, 2=continuous, 3=discrete, 4=numeric)" }, "Type of interval display (1=iso, 2=continuous, 3=discrete, 4=numeric)" },
{ F|O, "Light" , opt_view_light , 0. , { F|O, "Light" , opt_view_light , 1. ,
"Enable lighting for the view" }, "Enable lighting for the view" },
{ F|O, "LineType" , opt_view_line_type , 0. , { F|O, "LineType" , opt_view_line_type , 0. ,
"Display lines as solid color segments (0) or 3D cylinders (1)" }, "Display lines as solid color segments (0) or 3D cylinders (1)" },
......
// Define some general options
General.Trackball = 0; // use Euler angles General.Trackball = 0; // use Euler angles
General.RotationX = 30; General.RotationX = 30;
General.RotationY = 10; General.RotationY = 10;
...@@ -11,42 +9,13 @@ General.RotationZ = -15; ...@@ -11,42 +9,13 @@ General.RotationZ = -15;
View.ShowElement = 1; View.ShowElement = 1;
View.ColorTable = {Red,Green,Blue}; View.ColorTable = {Red,Green,Blue};
// Let's load the views one by one: // Load the views one by one to save momory
For i In {1:4} For i In {1:4}
If (i==1) Merge Sprintf("../tutorial/view%g.pos",i);
// we force the bounding box to be the one of the first view:
MergeWithBoundingBox "../tutorial/view1.pos";
EndIf
If (i>1)
// we merge the other views using the same bounding box as the
// first one:
Merge Sprintf("../tutorial/view%g.pos",i);
EndIf
Draw; Draw;
Print Sprintf("out%g.png",i); Print Sprintf("out%g.png",i);
// and we delete the view:
Delete View[0]; Delete View[0];
EndFor EndFor
// Why do we have to play such a game with the bounding box?
// If you don't load a geometry or a mesh at the same time as the
// views, the bounding box is only computed at the end of the loading
// of the main model file (the .geo). This is because a view should
// normally NOT affect the bounding box of a scene, except if the .geo
// file is indeed a view... So, without the MergeWithBoundingBox, the
// bounding box is indeed undefined (well, set to some stupid default
// value) when we want to draw our views (since this happens before
// the main file (the script) is completely read)...
// One solution would be to define dummy geometry points in the
// script. This is not general since we may not know beforehand the
// bounding box of the view. The correct way to handle this is to use
// MergeWithBounding box, which forces the computation of the bounding
// box.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment