POV-Ray : Newsgroups : povray.binaries.images : Localized damage to planes and edges : Localized damage to planes and edges Server Time
5 Nov 2024 09:25:14 EST (-0500)
  Localized damage to planes and edges  
From: Eriban
Date: 7 Jun 2009 08:25:01
Message: <web.4a2bb1616a2f4ef881475b100@news.povray.org>
Hi all,

For adding some damage to my WIP "Rock the Boat" I have been working on same
macros to create localized damage to planes and edges of box-shaped objects. A
marco for corners is still to follow.

The approach I have taken is as follows. Damage is specified by an object, to be
subtracted from the plane or edge. The damage macros then approximate this
damage by a mesh, also adding some extra erosion. The purpose of both the
mesh-approximation and additional erosion are to more smoothly integrate the
damage into the object. The mesh is closed so that it can be used for CSG.

The approach is illustrated in the attached image. From left to right:
1) The basic damage, when directly applied using CSG. On its own it is obviously
not very realistic.
2) The basic damage mesh, when flat triangles are used to show the mesh
structure.
3) The damage mesh when smooth triangles are used.
4) The end result, when a granite normal is used to further simulate damage.

Shown in red are the damage mesh objects generated by the macros, which have
been used to create the damage that is shown.

The DamagedEdge macro has support for rounded edges, which helps to smoothen the
transition from the damaged area to the undamaged rounded edge.

Creating these macros has been an interesting learning excercise for me, as I
had not created mesh2 objects before, nor used the trace function. I am also
hopeful that I can use the macros to good effect on my "Rock The Boat" scene.
However, I do have a few questions, which some of you may be able to answer.

Is the overall approach sensible, or could the same results have been obtained
in an easier way? The macros currently are about six hundred lines in total.

Do similar are better macros exist already? I am aware of Bill Pragnell's
meshrelief macros, which is an elegant and generic approach, but unfortunately,
did not seem appropriate for my current needs.

Is there a good way to more adaptively create the mesh? I am currently using a
hexagonal mesh pattern. The sample points have a bit of noise added, to break
up some of the regularity, but sampling is otherwise independent of the damage
object. The hexagonal pattern is still visible in some places, in particular at
the edges of the damage. Better results could be achieved when the samples are
taken adaptively, with a higher density of triangles where this is needed.
Implementing this would, however, not be straightforward. It would also be
nicer if it could be handled more generically. A simpler approach would be to
let the macros create a very high density mesh, and pass this mesh through a
mesh-optimisation tool that merges nearby mesh triangles that are very similar
in orientation. This should also result in a mesh-structure with an adaptive
density. Does such a tool exist, in particular one that's compatible with a
mesh format supported by POV-Ray?

Any other suggestions for improvement, thoughts, or comments?

Cheers,

Erwin


Post a reply to this message


Attachments:
Download 'damagestepbystep.png' (207 KB)

Preview of image 'damagestepbystep.png'
damagestepbystep.png


 

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