Using auto-include files from LDView POV export


Using auto-include files from LDView POV export
#1
Following some discussion elsewhere I figured it would be worth writing a bit about this issue. I'll add to this if I think of things and welcome questions.

Introduction

LDView has offered the option of POVray export for quite a while now. This allows some quite powerful manipulations via POVray. Here I'll focus on two important options: Top include file and Bottom include file.

As the name suggests this inserts a line including a file either up top (straight after all parameters have been declared) or down bottom (right at the end of the file). Combined with the list of parameters this allows quite a lot of automation via these include files, beyond that which could be expected from the export alone.

Top include file

This file is particularly useful for overriding colours but might also be used for other things. It has access to all parameters output by LDView including details of the camera, floor, model bounds and other details but typically would probably just include personal declarations for colours.

Note that the colours LDview declares are only ever called if the colour isn't already declared. So whatever colours you declare will carry through to all other parts.

I've attached my default file legocols.inc here (note it calls lugnetcolors.inc but you can comment this out).

Bottom include file

This file is very important. It can be used to declare the floor, override the camera, declare lights (if you don't like the defaults switch them off and set them here). And it too has access not only to the same declared parameters as the top include file, but also indirectly to the filename details [1].

For example I like to surround all my POVray files by a large sphere with a skymap to improve (IMO) render quality. This depends both on the distance of the lights and camera (they must be inside the sphere) but also on the floor position (so I can center the sphere appropriately). The details are unimportant but I can get all this useful information straight from the main file.

Similarly I like to set my own lights to improve rendering. Again these are set in the include file.

Perhaps most useful for many people (and the reason this file is called last) is the ability to use the include file to override the camera. POVray only ever uses the last declared camera so whatever is declared in the include file is what will be used in the rendering. This is especially useful for animation. Note that the camera you set here means the camera set by LDView will be ignored. If you wish to use the camera set by LDView you must use the parameters LDXCameraLoc, LDXCameraSky and LDXCameraLookAt

I've attached my default file ldview.inc here (it may not run due to other files but it can be read).



[1] If you know the filename of the main submodel or model (for ldr files) just set
Code:
#ifdef (LDX_Filename_ldr)
Model specific actions go here
#end
and you can deal with special cases in a generic way.


Attached Files
.inc   legocols.inc (Size: 17.58 KB / Downloads: 1)
.inc   LDView.inc (Size: 1.74 KB / Downloads: 2)
.inc   floorsphere.inc (Size: 1.27 KB / Downloads: 1)
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Using auto-include files from LDView POV export - by Tim Gould - 2011-11-29, 2:35
Re: Using auto-include files from LDView POV export - by Anonymous User - 2013-08-07, 17:59

Forum Jump:


Users browsing this thread: 3 Guest(s)