Hello, I'm trying to find all of the visible points from the point of view of a given BaseDraw. It seems like CalculateVisiblePoints() should be exactly what I need, but I'm not getting results that make any sense to me.
It seems like the function would do exactly what I'm looking for and a search only turned up a thread about it not being available in Python from years ago. I've seen other threads about getting visible object points, but I wanted to see if CalculateVisiblePoints() would work before moving onto one of those.
My tests have just involved a polygon cube and rotating around it, but the visible points aren't consistent with the view.
My current code:
BaseObject* child =op->GetDown();
if(child== nullptr ||child->GetType() != Opolygon)
{
return;
}
PolygonObject* polyobj = static_cast<PolygonObject*>(child);
BaseDraw* bd = doc->GetActiveBaseDraw();
if(bd==nullptr)
{
return;
}
Vector* vectors = polyobj->GetPointW();
UChar* results;
if (CalculateVisiblePoints(bd, polyobj, vectors, results, TRUE) == FALSE)
{
return;
}
Int32 pointcount =polyobj->GetPointCount();
for (Int32 x=0; x<pointcount; x++)
{
if (results[x] ==1)
{
ApplicationOutput(String::IntToString(x) + " Visible");
}
else if (results[x] ==0)
{
ApplicationOutput(String::IntToString(x) + " Not Visible");
}
else
{
ApplicationOutput("-Empty-");
}
}
Thanks for any help,
Dan