POV-Ray : Newsgroups : povray.newusers : Shoot a ray at a mesh : Re: Shoot a ray at a mesh Server Time
28 Jul 2024 16:16:41 EDT (-0400)
  Re: Shoot a ray at a mesh  
From: Chris B
Date: 7 Jun 2008 03:36:25
Message: <484a3a79$1@news.povray.org>
"daviddoria" <nomail@nomail> wrote in message 
news:web.4849ebdb784caf0d145cec320@news.povray.org...
> Thanks for the quick responses!  It sounds like using POV ray for this may 
> be
> overkill? Is there an easier approach that someone can recommend? It seems 
> like
> it should be possible to shoot rays at a model without converting it to a 
> POV
> ray scene (of course not with POV ray though haha!).
>

Whether there's an easier approach depends largely on where you're starting 
from and where you're going with this.

If you're developing an application that reads the obj file you may find it 
easiest to use the application code examples outlined at the following URL:
http://www.codeproject.com/KB/graphics/Simple_Ray_Tracing_in_C_2.aspx?display=Print

If you're using a particular modeller to generate or process the obj file, 
then that modeller may provide something that can perform that sort of 
calculation for you. Various modellers now support their own form of 
scripting.

If you're a dab hand at Perl scripting then you might find it easiest to 
read the vertices of the triangles directly from the obj file (it's just a 
plain ASCII file) and calculate the intersection point triangle by triangle. 
If the line intercepts multiple triangles you just keep track of the one 
closest to your start point.

> If not, is there some linux equivalent of pose ray?

According to the announcement at 
http://news.povray.org/povray.news-submissions/thread/%3C451a0953@news.povray.org%3E/?ttop=274065&toff=50

you can run PoseRay on Linux using Wine 0.9.21.

Regards,
Chris B.


Post a reply to this message

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