forked from jamesra/VikingPlot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CreateRenderingFigure.m
50 lines (39 loc) · 1.28 KB
/
CreateRenderingFigure.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
function [ hFig, hAxes ] = CreateRenderingFigure(varargin)
%CREATERENDERINGFIGURE Create the figure used to render meshes
%WindowSize - Size of window, tuple
%Renderer - Renderer to use, string
%ReverseZ - bool, if true reverse the Z-axis
WindowSize = [0 0 1024 768];
renderer = 'opengl';
ZDir = 'normal';
light_elevation = 30;
optargin = size(varargin,2);
if(optargin >= 1)
WindowSize = varargin{1};
end
if(optargin >= 2)
renderer = varargin{2};
end
if(optargin >= 3)
ReverseZ = varargin{3};
if(ReverseZ)
ZDir = 'reverse';
light_elevation = -light_elevation;
end
end
hFig = figure('Units', 'Pixels', ...
'OuterPosition', WindowSize, ...
'Renderer', renderer, ...
'Color', [0 0 0]);
hAxes = axes('color', [0 0 0], ...
'FontWeight', 'bold', ...
'XColor', [.5 .5 .5], ...
'YColor', [.5 .5 .5], ...
'ZColor', [.5 .5 .5], ...
'Position', [0 0 1 1], ...
'DataAspectRatio', [1 1 1], ...
'ZDir', ZDir);
hold on;
lightangle(45,light_elevation);
lightangle(225,light_elevation);
end