POV-Ray : Newsgroups : povray.unofficial.patches : Problem with Superpatch trace function : Problem with Superpatch trace function Server Time
2 Sep 2024 22:20:34 EDT (-0400)
  Problem with Superpatch trace function  
From: Vahur Krouverk
Date: 16 Jun 1999 13:53:43
Message: <3767E4A9.EC9427EF@fv.aetec.ee>
Hello!

I tried to use trace function from superpatch and trace intersection
with mesh object, but superpatch gave access violation. I D/L SuperPatch
source code and rebuilt project and as it appears, problem is with
uninitialized mesh queue. 

Parse_Trace function calling results finally in calling function
intersect_bbox_tree (mesh.c): 
*************************************
static int intersect_bbox_tree(MESH *Mesh, RAY *Ray, RAY  *Orig_Ray, DBL
len, ISTACK *Depth_Stack)
{
  int i, found;
  DBL Best, Depth;
  RAYINFO rayinfo;
  BBOX_TREE *Node, *Root;

  /* Create the direction vectors for this ray. */

  Create_Rayinfo(Ray, &rayinfo);

  /* Start with an empty priority queue. */

  found = 0;

  Mesh_Queue->QSize = 0;
        /\
---------

But Mesh_Queue is initialized after parse (in function
Initialize_Mesh_Code) and null pointer exception occurs. I put
Initialize_Mesh_Code call before calling Parse (after Init_Blob_Queue)
in FrameRender function (povray.c)  and this seemed to fix this problem. 

Perhaps there is other uninitialized structures as well, which could
cause problems during this trace function, but at first sight I haven't
noticed such ones.


Post a reply to this message

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