[scripting] Accuracy of PointLocator Data?

Date : Thu, 14 Feb 2008 10:33:52 +0000
To : XSI(at)Softimage.COM
From : Julian Johnson <julian(at)exch.demon.co.uk>
Subject : [scripting] Accuracy of PointLocator Data?
I'm using pointlocator data in a simple geometry script to hook together two vertices i.e. I want to find the nearest vertex to a given position. For an example of what I'm trying to do see here:

http://www.exch.demon.co.uk/files/pointlocator.gif

I've set up the closestlocation query to return vertices/knots etc. (Here's a snippet from the code)

oGeo.SetupClosestLocationQueries(0,oPTrans)
PointLocators = oGeo.GetClosestLocations(((nuVec.X,),(nuVec.Y,),(nuVec.Z,)))
vertid = oGeo.GetTriangleVertexIndexArray(PointLocators)

vertid returns an array of three identical vertex indices (as it should).

Some of the time the nearest vert is identified correctly and everything works fine. However, quite often the query returns an adjacent vert.

Is there something about the pointlocator algorithm that I'm missing that would explain why it doesn't always pick up the correct vert? i.e. is it looking primarily for surfaces whose normal is pointing towards the vertex?

Each time I run the query the Geometry object is re-called so the acceleration cache should be fine...

Julian
========================================

This e-mail (and any attachments) is confidential and may contain personal views which are not the views of Men-from-Mars unless specifically stated.

If you have received it in error, please delete it from your system. Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi



Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.