Thanks for the reply, some very useful approaches to bear in mind!I spent many cycles thinking about this one over the last couple of days.I seem to have a result in cga this morning, another alternative. 🙂I decided that finding the highest vertices was probably not the best approach for the application I was trying to achieve.Finding the highest logical point for the proxy light to be placed was the goal. (read bottom up, its a maya mel'ism I struggle to shake )
attr aabbYMax=0
ProxyPointLight -->
/*
Insert a pointlight representation
- using scatter to a only place one asset on the surfaces that are at the top
*/
scatter(surface,1,gaussian, top, 0)
{
s(0,0,0)
i("assets/proxies/pointLight.obj")
color("#ff0000")
PointLight. // now this just needs to be reported
}
ProxyTopDetail -->
/*
ProxyTopDetail is a shape that produces a representation of a roof top detail model
such as a tv/radio mast geometry on the top of a building
*/
s(0,scaleValue*assetInfo(bldTopDtl,sy),0)
i(bldTopDtl)
TopDetail.
// work out the top value of the bounding box,
// could be used later if needed for culling.. if needed
// i have a random scale value, within a tolerance for these kind of details
set(aabbYMax, (scope.elevation + (scaleValue*assetInfo(bldTopDtl, sy))))
print ("aabbYMax: " + aabbYMax)
//split out only object.top facing faces
comp(f)
{
//use separated faces as one shape
object.top=
color("#ff0000")
alignScopeToAxes(y)
ProxyPointLight
}