POV-Ray : Newsgroups : povray.general : internal data access Server Time
1 Aug 2024 12:27:49 EDT (-0400)
  internal data access (Message 1 to 3 of 3)  
From: David El Tom
Subject: internal data access
Date: 18 Sep 2005 05:09:13
Message: <432d2eb9@news.povray.org>
Hi there,

while working on something hairy, I stumbled over several includes and 
macros available throughout the net. But unfortunately all seem to work 
only in conjunction with external programs like the MeshCompressor (by 
C. Colefax if I renember wright).

Is it possible (or planned) to access the internal data structure of a 
mesh through SDL. (like MESH_IDENTIFIER.vertex[number_of_vertex] or 
MESH_IDENTIFIER.face[number_of_face] etc. ?

This would make it possible to write macros for placing things evenly 
distributed on a mesh, which could also had been created by an macro in 
first place, without the need of external programs, writing the whole 
mesh crap to disk or the neccessarity of writing an own mesh parser in SDL.

answers are welcome ;-)

.... dave


Post a reply to this message

From: Chris B
Subject: Re: internal data access
Date: 27 Sep 2005 17:46:54
Message: <4339bdce$1@news.povray.org>
"David El Tom" <dav### [at] t-onlinede> wrote in message 
news:432d2eb9@news.povray.org...
> Hi there,
>
> while working on something hairy, I stumbled over several includes and 
> macros available throughout the net. But unfortunately all seem to work 
> only in conjunction with external programs like the MeshCompressor (by C. 
> Colefax if I renember wright).
>
> Is it possible (or planned) to access the internal data structure of a 
> mesh through SDL. (like MESH_IDENTIFIER.vertex[number_of_vertex] or 
> MESH_IDENTIFIER.face[number_of_face] etc. ?
>
> This would make it possible to write macros for placing things evenly 
> distributed on a mesh, which could also had been created by an macro in 
> first place, without the need of external programs, writing the whole mesh 
> crap to disk or the neccessarity of writing an own mesh parser in SDL.
>
> answers are welcome ;-)
>
> .... dave

Hello Dave,

I'm not aware of anything that gives you direct access to the internal data 
structures from the SDL. However, I've used a couple of ways of achieving 
the sort of thing you describe.

One is to use trace() to fire a random series of rays at an object to detect 
points and normals (for growing hairs out of).

The other has been to generate points into an array and then generate a mesh 
from that. Then you can use the same array for other tasks, such as 
distributing things evenly on the surface of the mesh.

Regards,
Chris B.


Post a reply to this message

From: David El Tom
Subject: Re: internal data access
Date: 28 Sep 2005 00:34:15
Message: <433a1d47@news.povray.org>
Chris B wrote:
> 
> Hello Dave,
> 
> I'm not aware of anything that gives you direct access to the internal data 
> structures from the SDL. However, I've used a couple of ways of achieving 
> the sort of thing you describe.
> 
> One is to use trace() to fire a random series of rays at an object to detect 
> points and normals (for growing hairs out of).
> 
> The other has been to generate points into an array and then generate a mesh 
> from that. Then you can use the same array for other tasks, such as 
> distributing things evenly on the surface of the mesh.
> 
> Regards,
> Chris B. 
> 

thank you for your suggestions,

the problem I had was to distribute a number of points evenly on a 
complex mesh.
The method of shooting rays in a random fashion is well known to work 
well with simple meshes or nearly planar heightfields. The drawback of 
this method is that you normaly miss the hidden surfaces and all 
surfaces which are perpendicular to the ray.

In the meanwhile I came up with methode which is quite analogue to your 
second suggestion. I wrote a PERL script which reads an include with a 
mesh in mesh2 format and drops me an include with arrays of points, 
normals and corresponding uv's (if aviable).

take a look at p.b.images + p.b.utilities for details.

.... dave


Post a reply to this message

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