estimating an area

Blitz3D Forums/Blitz3D Programming/estimating an area

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I need to estimate the area of an object facing the camera.

This is what I've come up with so far.

frontarea#=50.0
Toparea#=50.0
sidearea#=50.0
totalarea#=0.0

yaw#=45.0
pitch#=0.0
roll#=0.0

totalarea#=Abs(Sin(yaw#)*sidearea#)+Abs(Cos(yaw#)*(Abs(Sin(pitch#)*toparea#)+Abs(Cos(pitch#)*frontarea#)))

Print "Total: "+totalarea#

WaitKey()


It seems to work(although I haven't done much testing), but is there an easier or faster way of doing it?

Any input would be very welcome!

Andy