ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra/bin/cfxmlrender
(Generate patch)

Comparing deliantra/Deliantra/bin/cfxmlrender (file contents):
Revision 1.2 by elmex, Sat Apr 22 04:49:05 2006 UTC vs.
Revision 1.3 by elmex, Sat Apr 22 10:18:44 2006 UTC

3use Storable qw/dclone/; 3use Storable qw/dclone/;
4use Math::Trig; 4use Math::Trig;
5use XML::Parser; 5use XML::Parser;
6use XML::Writer; 6use XML::Writer;
7use Cwd; 7use Cwd;
8use Math::VectorReal;
9$Math::VectorReal::FORMAT = "x=\"%1.3f\" y=\"%1.3f\" z=\"%1.3f\"";
10use File::Spec::Functions; 8use File::Spec::Functions;
11use strict; 9use strict;
12 10
13our $DEBUG = 0; 11our $DEBUG = 0;
14 12
239 ); 237 );
240 }; 238 };
241 239
242 240
243 my ($w, $h) = ($cfg->{w}, $cfg->{h} || $cfg->{w}); 241 my ($w, $h) = ($cfg->{w}, $cfg->{h} || $cfg->{w});
244 my $to = vector (0, 0, 0); 242 my @to = (0, 0, 0);
245 my $from = vector (0, 0, $cfg->{height}); 243 my @from = (0, 0, $cfg->{height});
246 my $up = vector (0, 1, 0)->norm; 244 my @up = (0, 1, 0);
247 $up = $from + $up; 245 @up = map { $up[$_] + $from[$_] } 0..2;
248 246
249 add_tags ($tree, 247 add_tags ($tree,
250 light => [ 248 light => [
251 { type => 'sunlight', name => 'w_Infinite', power => "0.5", 249 { type => 'sunlight', name => 'w_Infinite', power => "0.5",
252 cast_shadows => "off" 250 cast_shadows => "off"
267 add_tags ($tree, 265 add_tags ($tree,
268 camera => [ 266 camera => [
269 { name => "xcam", resx => $w, resy => $h, focal => "10", 267 { name => "xcam", resx => $w, resy => $h, focal => "10",
270 type => "ortho" }, 268 type => "ortho" },
271 to => [{ x => 0, y => 0, z => 0 }], 269 to => [{ x => 0, y => 0, z => 0 }],
272 from => [{ x => 0, y => $from->y, z => $from->z }], 270 from => [{ x => 0, y => $from[1], z => $from[2] }],
273 up => [{ x => $up->x, y => $up->y, z => $up->z }], 271 up => [{ x => $up[0], y => $up[1], z => $up[2] }],
274 ], 272 ],
275 render => [ 273 render => [
276 { camera_name => "xcam", raydepth => "4", 274 { camera_name => "xcam", raydepth => "4",
277 gamma => "1", 275 gamma => "1",
278 exposure => "0", save_alpha => "on", 276 exposure => "0", save_alpha => "on",

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines