LDraw.org Discussion Forums
LDView - Fixed Camera Positioning - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html)
+--- Forum: LDraw Editors and Viewers (https://forums.ldraw.org/forum-11.html)
+--- Thread: LDView - Fixed Camera Positioning (/thread-6158.html)



LDView - Fixed Camera Positioning - Rob - 2012-09-07

Hi

I am using LDView v4.1 for Windows.

I'm trying to work out the command line parameters to render a snapshots of different models files.

I want a fixed camera position regardless of the model size or location. I've tried all manner of combinations of -ModelSize -Autocrop -FOV -ZoomToFit -ModelCenter etc. etc. but cannot seem find the right combination.
I thought the -cg45,45,1000 would do it (lat,long,distance) but this seems to get different results depending on the size/location of the model in question.

Any help greatly appreciated....

TCBUK


Re: LDView - Fixed Camera Positioning - Travis Cobbs - 2012-09-07

As far as I know, -cg30,45,<n> (where <n> must be determined empirically) should mostly do what you want, but there are a few other options you might need additionally. Note that <n> is dependent on the FOV setting (e.g., -FOV=25). If you decrease the field of view, you must increase the distance to produce a similar result.

Adding -ZoomMax=10000 to the command line will decrease the probability of the camera being pushed away due to being too close. (LDView by default doesn't allow the camera to get close enough to the model so that rotations could result in it being inside the model.) You might instead be able to use -ViewMode=1 (which switches to fly-through mode, where the zoom level isn't constrained at all). However, I don't think I've ever tried that on the command line. The viewing mode is generally useless for command line snapshots, since there's no interaction, but since zoom contraints are disabled in fly-through mode, I think -ViewMode=1 will accomplish that on the command line.

By default the model is centered, so the its origin is ignored. Use -ModelCenter=0,0,0 if you want to disable the auto-centering.


Re: LDView - Fixed Camera Positioning - Rob - 2012-09-08

Many thanks for the response - and from the author of LDView I think - excellent.

For your info:

What I'm trying to do is create the frames for an animation such as this (I created this one).

http://www.youtube.com/watch?v=TudW-8FjMzE

This was done using POV-Ray but took about 3 weeks running on 3 machines to render all the necessary frames.
(I wrote an application to create the individual LDR files for each frame from the source LDR file).

What I would like to do, so that I can test the animations, and possibly for creating quick render animations that would take hours not weeks to create, is to use LDView snapshots to create the frames - but I having problems keeping the camera view fixed - hence the original post.

I have tried your suggestions but still get different camera views.

I have attached the two LDR files and commandline batch file I'm using for testing. One is a base plate on its own and one is a base plate with a tower of 2x2 bricks in the centre. I'm aiming to create two snap shots which are from the same camera position...

Regards
Rob (TCBUK)


Re: LDView - Fixed Camera Positioning - Tore Eriksson - 2012-09-08

Hi tcbuk,

This looks so very interesting and so close to what I've tried to accomplish starting at 1997 I believe, that I might even have an LDraw relapse. Smile

If you are interested in sharing our experiences, could you please email me at [email protected] ?

TIA,
Tore


Re: LDView - Fixed Camera Positioning - Roland Melkert - 2012-09-08

I'm assuming you are using LDView to generate the pov scripts, so maybe it's an idea to overwrite it's camera definition with a static include file using post processing.

Just my 2 cents.


Re: LDView - Fixed Camera Positioning - Rob - 2012-09-08

Thanks for the input Roland.

Using L3P and POVRay I have no problem creating animated builds of Lego models.

What I want to do is to be able to create the same animations, but much more quickly, by using LDView.

LDView does eveything I need via its command line but - as per my original post - I am unable to keep the camera 'looking' at the same point in space, same zoom etc, for each frame.

Rob (TCBUK)


Re: LDView - Fixed Camera Positioning - Travis Cobbs - 2012-09-08

It appears to be a bug in LDView. I'll have to investigate to figure out the cause.

In the meantime, there is a solution that works with your sample model, and may be something you can use to do what you want. Add the following line immediately after the line in the second file that specifies the baseplate:
Code:
0 !LDVIEW BBOX_IGNORE BEGIN

Add the following line to the end of the file:
Code:
0 !LDVIEW BBOX_IGNORE END

The above makes the problem go away here. The !LDVIEW BBOX_IGNORE meta-command instructs LDView to ignore the contained geometry when calculating the model's bounding box. Something with that bounding box calculation is responsible for the bug that is causing the model to move around, so if you only allow LDView to use the baseplate when calculating the bounding box, and the baseplate is included in every step, hopefully it will generate images like you want.


Re: LDView - Fixed Camera Positioning - Rob - 2012-09-08

Travis - many thanks.

Initial tests show that this seems to fix the issue - I'm actually adding the meta commands at the top and bottom of the file so in theory its ignoring the bounding box calculation for the whole model ? - but in anycase gives me what I wanted which is a fixed view on for each frame of the model.

Do you have a 'donate' button somewhere ?

Kind regards

Rob (TCBUK)