POV-Ray : Newsgroups : povray.advanced-users : clutter.mcr and trace() : Re: clutter.mcr and trace() Server Time
12 Jun 2024 14:29:15 EDT (-0400)
  Re: clutter.mcr and trace()  
From: Thomas de Groot
Date: 21 May 2021 02:32:56
Message: <60a75418$1@news.povray.org>
Op 20/05/2021 om 17:46 schreef Mike Horvath:
> On 5/20/2021 4:49 AM, Thomas de Groot wrote:
>> I did some more testing. I think you should look at the /original/ 
>> landscape file and see how that was converted to mesh and/or mesh2. I 
>> guess something is wrong (as far as POV-Ray is concerned) with its 
>> normal handling: the .ldr file? the .stl file? Either LDraw or MeshLab 
>> do not do the job correctly; I guess LDraw more than MeshLab...
>>
> 
> 
> Thank you so much for taking a deeper look!
> 
> LDraw does not store normal data at all. None whatsoever. It only stores 
> the vertices. A program called LDCad is used to convert from LDraw 
> format to POV-Ray mesh2 format.
> 
> So, do you think that the LDraw to mesh2 converter is having some 
> issues? I can inform the programmer.
> 
Well, if no normals are stored you got a problem indeed. What trace 
does, on whatever surface it is pointed to, is to control the normal of 
the first face it hits, and change its own (preset) normal <0,0,0> to 
the normal of the face. With the location of the hit point /and/ the 
normal's value, you get a point and orientation for the object to be 
posed on the surface. So, it is all about *faces* and their *normals*. 
If no normals are present, the object is "transparant" to trace.

I am pretty sure now that the LDraw to mesh2 converter has an issue, but 
before that, LDraw has a problem if it only stores vertices. Somewhere 
on the road, faces (triangles or quadrangles) need to be generated with 
their corresponding normals. That is how all 3D programs I know work, 
being it Silo or Wings3D or Poser, to mention a few. Poseray besides, is 
one of the best utilities I know to convert a large body of formats 
(obj, 3ds, lwo, dxf, raw, inc, pov, wrl, gz) to mesh2 objects. 
Unfortunately it does not convert directly from LDraw. If LDraw could 
export to one of these formats (inc and pov /only/ for mesh and mesh2), 
Poseray would do the job accurately, provided that face normals are present.

-- 
Thomas


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.