Camera, lights - Printable Version +- LDraw.org Discussion Forums (https://forums.ldraw.org) +-- Forum: General (https://forums.ldraw.org/forum-12.html) +--- Forum: Official File Specifications/Standards (https://forums.ldraw.org/forum-32.html) +--- Thread: Camera, lights (/thread-21721.html) |
Camera, lights - Michael Horvath - 2016-08-21 What is the official method of adding cameras and light sources to models? I was thinking it would be nice to add camera/lookat and lightsource/pointat pairs in a single line in a model. This would require some sort of extension. Has someone done this before? RE: Camera, lights - Roland Melkert - 2016-08-21 (2016-08-21, 13:05)Michael Horvath Wrote: What is the official method of adding cameras and light sources to models? I've been working on animation POV-Ray export for LDCad 1.6 and was wondering about this a while back. In the end I choose to have camera's (and lights) only exist during playback so no meta storage. Also light and camera have many options which will differ between renderers so if a official meta is considered I think it should be user extendable. RE: Camera, lights - Travis Cobbs - 2016-08-22 (2016-08-21, 13:05)Michael Horvath Wrote: What is the official method of adding cameras and light sources to models? The official file light.dat was designed to be used for this. That file was created by James Jessiman, so it's been around for a long time. The color you use to specify this file is the color of the light source. (Same with the brightness.) Unfortunately, there's no real standard on how this should be used for a light source. LDView supports light.dat for its real-time 3D rendering, converting it into an OpenGL point light source (paying attention to the RGB value of the model reference to determine color and brightness). But I never got around to supporting it during POV export (although I'm pretty sure it would be possible to hack in support after-the-fact using a top include). RE: Camera, lights - Michael Horvath - 2016-08-22 Just want to add that light.dat by itself is not enough for spotlights. Which is why it would be nice to specify them as a pair. RE: Camera, lights - Tore Eriksson - 2016-11-06 (2016-08-22, 14:00)Michael Horvath Wrote: Just want to add that light.dat by itself is not enough for spotlights. Which is why it would be nice to specify them as a pair. This could be done with my Datshine program, but it takes knowledge in POV-Ray coding and inlining POV code into LDraw files. RE: Camera, lights - Tore Eriksson - 2016-11-06 (2016-11-06, 12:34)Tore Eriksson Wrote:(2016-08-22, 14:00)Michael Horvath Wrote: Just want to add that light.dat by itself is not enough for spotlights. Which is why it would be nice to specify them as a pair. This is not a spotlight, but a general illumntion "Light Brick" I made with DatShine of a 1x4 plate. In ML-Cad and LDView, it looks like a normal clear 1x4 plate. but in POV-ray, it emitts light. I know there is POV code for spotlights, too, but I never experimented with it. Code: 0 Plate 1 x 4 Clear with POV Light It works with L3P, with or without L3PAO, but I'm not sure if it works with LDView. Here's the result: RE: Camera, lights - Michael Horvath - 2016-11-07 (2016-11-06, 12:34)Tore Eriksson Wrote:(2016-08-22, 14:00)Michael Horvath Wrote: Just want to add that light.dat by itself is not enough for spotlights. Which is why it would be nice to specify them as a pair. Do you have a link to DatShine? RE: Camera, lights - Tore Eriksson - 2016-11-07 (2016-11-07, 15:41)Michael Horvath Wrote:(2016-11-06, 12:34)Tore Eriksson Wrote: This could be done with my Datshine program, but it takes knowledge in POV-Ray coding and inlining POV code into LDraw files. I didn't, but now I have. DatShine for Windows There's a minor bug in it. You'll have to insert "0 " at the beginning of each created part's first line. I would correct it, but I don't think I have the source code left. Sorry, no instructions. If you get stuck, I can guide you through. RE: Camera, lights - Michael Horvath - 2016-11-07 (2016-11-07, 16:14)Tore Eriksson Wrote:(2016-11-07, 15:41)Michael Horvath Wrote: Do you have a link to DatShine? What does this program even do? RE: Camera, lights - Tore Eriksson - 2016-11-08 (2016-11-07, 17:18)Michael Horvath Wrote:I posted a reply here, but it looks like it never made it(?)(2016-11-07, 16:14)Tore Eriksson Wrote: I didn't, but now I have. It changes the property of the parts into shining objects. See the lights in the ceiling of the Moonbase above, and the headlights of the car in this post. They still look normal in any LDraw editor or viewer, and once vreated by DatShine, you treat them as any other LDraw part. But after being processed by L3P, those parts emit light in POV-Ray. I'm sure you can make a spotlight object in Datshine if you know the POV syntax for spotlights. RE: Camera, lights - Michael Horvath - 2016-11-09 (2016-11-08, 0:13)Tore Eriksson Wrote:(2016-11-07, 17:18)Michael Horvath Wrote: What does this program even do?I posted a reply here, but it looks like it never made it(?) I just remembered that *all* lights in POV-Ray have a default "point_at" value of <0,0,1>. This does not matter much for point lights maybe, but it affects all other types of lights. See: http://wiki.povray.org/content/Reference:Light_Source Even with DatShine there still needs to be a way to set the "point_at" vector IMO. RE: Camera, lights - Michael Horvath - 2016-11-17 (2016-08-21, 13:05)Michael Horvath Wrote: What is the official method of adding cameras and light sources to models? The benefit of using parts for this are that they get translated/rotated along with the rest of the model they belong to. I don't know how to accomplish this in POV-Ray alone. This is (or will be) very important for Datsville! |