Camera.dat workflow


Camera.dat workflow
#1
I have added several "camera.dat" files to my scene to mark the locations where I want to place a camera in POV-Ray. What do I do after that? How do I get the camera positions after I have made the conversion to POV-Ray? Does LDView support these parts in the conversion process? Do I need to inline the entire MPD model first? I know I've done this in the past, but I don't remember how. And I no longer have those files in my backups.

Thanks!
Reply
RE: Camera.dat workflow
#2
(2016-09-06, 21:33)Michael Horvath Wrote: I have added several "camera.dat" files to my scene to mark the locations where I want to place a camera in POV-Ray. What do I do after that? How do I get the camera positions after I have made the conversion to POV-Ray? Does LDView support these parts in the conversion process? Do I need to inline the entire MPD model first? I know I've done this in the past, but I don't remember how. And I no longer have those files in my backups.

Thanks!

Unfortunately, LDView does not support camera.dat in any way. I don't know if there are other tools to generate POV camera statements based on camera.dat.
Reply
RE: Camera.dat workflow
#3
(2016-09-06, 23:53)Travis Cobbs Wrote:
(2016-09-06, 21:33)Michael Horvath Wrote: I have added several "camera.dat" files to my scene to mark the locations where I want to place a camera in POV-Ray. What do I do after that? How do I get the camera positions after I have made the conversion to POV-Ray? Does LDView support these parts in the conversion process? Do I need to inline the entire MPD model first? I know I've done this in the past, but I don't remember how. And I no longer have those files in my backups.

Thanks!

Unfortunately, LDView does not support camera.dat in any way. I don't know if there are other tools to generate POV camera statements based on camera.dat.

Does your program still support "light.dat"? I tested it and all I see is this code:


Code:
#declare LDX_light_dot_dat =
#if (LDXQual = 0)
box {
<-4,-4,-4>,<4,4,4>
}
#else
union {
// Pov-RAY Light Source
// Name: light.dat
// Author: James Jessiman
// !LDRAW_ORG Part ORIGINAL
// !LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt
// !HISTORY 2007-07-29 [PTadmin] Header formatted for Contributor Agreement
// !HISTORY 2008-07-01 [PTadmin] Official Update 2008-01
}
#end

The code block appears empty except for comments, so I think it is not working.
Reply
RE: Camera.dat workflow
#4
(2016-09-07, 1:06)Michael Horvath Wrote: Does your program still support "light.dat"? I tested it and all I see is this code:


Code:
#declare LDX_light_dot_dat =
#if (LDXQual = 0)
box {
<-4,-4,-4>,<4,4,4>
}
#else
union {
// Pov-RAY Light Source
// Name: light.dat
// Author: James Jessiman
// !LDRAW_ORG Part ORIGINAL
// !LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt
// !HISTORY 2007-07-29 [PTadmin] Header formatted for Contributor Agreement
// !HISTORY 2008-07-01 [PTadmin] Official Update 2008-01
}
#end

The code block appears empty except for comments, so I think it is not working.

LDView has never supported light.dat for POV exports. Having said that, it would be possible to create an file named light_dat.inc with a light definition inside it and add a reference to that inc file in LGEO.xml for light.dat. The light_dat.inc file could look something like so:

Code:
#declare LDX_light_dot_dat =
light_source {
    <0,0,0>
    color rgb <1,1,1>
}

The new entry in LGEO.xml would go in the <Elements> section, and would look like this:

Code:
       <Element>
           <LDrawFilename>light.dat</LDrawFilename>
           <POVName>LDX_light_dot_dat</POVName>
           <POVFilename>light_dat.inc</POVFilename>
           <MatrixRef>LGEOTransform</MatrixRef>
       </Element>

One down side is that it would ignore the color, and I don't think there's anything that can be done about that.
Reply
RE: Camera.dat workflow
#6
(2016-09-06, 23:53)Travis Cobbs Wrote: Unfortunately, LDView does not support camera.dat in any way. I don't know if there are other tools to generate POV camera statements based on camera.dat.

I've been working on POVRay export for LDCad 1.6 but it is more animation orientated.

Is camera.dat an offical part? I can't seem to find it though.

I've been (mis)using the below combined with scripts in my current tests:

Code:
0 FILE camera.ldr
1 0 0 25 -37 -1 0 0 0 1 0 0 0 -1 30148.dat

This places the 'lens' at the part origin pointing into the local z-axis but you still need to set the zoom fov etc manually (through script also) same goes for lights if you want anything else besides point lights.
Reply
RE: Camera.dat workflow
#9
Photo 
(2016-09-07, 16:53)Roland Melkert Wrote: I've been working on POVRay export for LDCad 1.6 but it is more animation orientated.

Is camera.dat an offical part? I can't seem to find it though.

I've been (mis)using the below combined with scripts in my current tests:

Code:
0 FILE camera.ldr
1 0 0 25 -37 -1 0 0 0 1 0 0 0 -1 30148.dat

This places the 'lens' at the part origin pointing into the local z-axis but you still need to set the zoom fov etc manually (through script also) same goes for lights if you want anything else besides point lights.

I believe I'm the only one using the private and highly unofficial files camera.dat and look_at.dat. Those are supported by L3PAO and LDA. It doesn't matter what content they have, the only thing that really matters is their file names. These are my files:


Code:
0 ~Camera Position
0 Name: Camera.dat
0 Author: Tore Eriksson
0 Un-official part

2 24  -40 0 0  40 0 0
2 24  0 -40 0  0 40 0
2 24  0 0 -40  0 0 40
0 L3P IFNOTPOV
1 0  0 25 -37  -1 0 0  0 1 0  0 0 -1  30148.dat
0 L3P ENDPOV
0
Code:
0 ~Look_at Position
0 Name: look_at.dat
0 Author: Tore Eriksson
0 Un-official part

2 24  -20 0 0  20 0 0
2 24  0 -200 0  0 20 0
2 24  0 0 -20  0 0 20
0 L3P IFNOTPOV
1 42  0 16 0  1 0 0  0 1 0  0 0 1  30153.dat
0 L3P ENDPOV
0
The usage is simple. You put the both file references in your model file with the desire positions and fire up L3PAO.
Code:
0 Example
0 Name: example.ldr

1 0  100 -80 0  1 0 0  0 1 0  0 0 1  camera.dat
1 0  64 -40 10  1 0 0  0 1 0  0 0 1  look_at.dat
1 7  0 0 0  1 0 0  0 1 0  0 0 1  model.ldr
0

L3PAO uses default camera settings...
[Image: before.png]


... until you click on the button marked "Get Camera and Look At settings from model file", and the program does just what the button says.
[Image: after.png]
Reply
RE: Camera.dat workflow
#5
Interesting. Thanks.
Reply
RE: Camera.dat workflow
#7
(2016-09-06, 21:33)Michael Horvath Wrote: I have added several "camera.dat" files to my scene to mark the locations where I want to place a camera in POV-Ray. What do I do after that? How do I get the camera positions after I have made the conversion to POV-Ray? Does LDView support these parts in the conversion process? Do I need to inline the entire MPD model first? I know I've done this in the past, but I don't remember how. And I no longer have those files in my backups.

Thanks!

Unfortunately, only L3PAO supports camera.dat and look_at.dat. And in Win10/64, I can't even get L3PAO started.  Sad   It was a really handy thing when you wished to store the camera settings inside the model file. Guess we'll have to set up an older PC just to use L3PAO.
Reply
RE: Camera.dat workflow
#8
(2016-11-06, 17:41)Tore Eriksson Wrote: Unfortunately, only L3PAO supports camera.dat and look_at.dat. And in Win10/64, I can't even get L3PAO started.  Sad   It was a really handy thing when you wished to store the camera settings inside the model file. Guess we'll have to set up an older PC just to use L3PAO.

PS. Looks like I got L3PAO working after reinstalling it. The decimal separator bug remains though. Maybe I'll need a special PC with American settings anyway...
Reply
RE: Camera.dat workflow
#10
(2016-11-06, 21:01)Tore Eriksson Wrote: Maybe I'll need a special PC with American settings anyway...
No need for a special PC, the only thing you need to do to avoid all these kind of problems is to set the decimal separator to "." instead of ",". I do this for years on all of my PCs and I have yet to see the downside. And in addition to solving the problems of software pieces that don't know that the world extend outside America, you can do nice things such as copy a value computed with Windows calculator directly into LDraw code!
Reply
RE: Camera.dat workflow
#11
(2016-11-07, 8:12)Philippe Hurbain Wrote:
(2016-11-06, 21:01)Tore Eriksson Wrote: Maybe I'll need a special PC with American settings anyway...
No need for a special PC, the only thing you need to do to avoid all these kind of problems is to set the decimal separator to "." instead of ",". I do this for years on all of my PCs and I have yet to see the downside. And in addition to solving the problems of software pieces that don't know that the world extend outside America, you can do nice things such as copy a value computed with Windows calculator directly into LDraw code!

Thank you! It works on L3PAO, but not the calculator or OpenOffice (Excel-ish). But that's not so important since I am used to search commas and replace them with point. OTOH, I don't know if I'm able to reprogram myself into entering numbers inte the calculator and spreadsheets with point instead of comma, so maybe it's for the best.
Reply
RE: Camera.dat workflow
#12
Any idea on how I could convince the new Calculator in Win10 that the comma on my numpad is a point?
Reply
RE: Camera.dat workflow
#13
(2016-11-07, 23:13)Magnus Forsberg Wrote: Any idea on how I could convince the new Calculator in Win10 that the comma on my numpad is a point?

It's pointless. (sorry, couldn't help...)
Reply
RE: Camera.dat workflow
#14
(2016-11-07, 23:13)Magnus Forsberg Wrote: Any idea on how I could convince the new Calculator in Win10 that the comma on my numpad is a point?

I'm pretty sure you'd have to either tell Windows that you have a US keyboard (probably a bad idea), or find a program that remaps keys.
Reply
RE: Camera.dat workflow
#15
(2016-11-07, 23:13)Magnus Forsberg Wrote: Any idea on how I could convince the new Calculator in Win10 that the comma on my numpad is a point?
Looks like it was a good idea to resist to the forced upgrade of my Seven... I do have a point on my French keyboard numpad!
Reply
RE: Camera.dat workflow
#16
I've made that change many years ago, and it works as a point in every software I use, except in the new "upgraded" Calculator.
Very strange.
Reply
RE: Camera.dat workflow
#17
Bill outsmarted us again...
Reply
RE: Camera.dat workflow
#18
(2016-11-08, 16:27)Magnus Forsberg Wrote: I've made that change many years ago, and it works as a point in every software I use, except in the new "upgraded" Calculator.
Very strange.

Even stranger: After reboot, my calculator shows a point on the GUI, takes both the point from the alphabet part and the comma from the numpad side and transforms them to deciaml points, but it does not respond to the comma to the left of the alphabet-side point.

But this has very little to do with camera.dat or any other approach to control camera settings from inside an LDraw file. Smile
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)