![]() |
Forum Index : Microcontroller and PC projects : CMM2: 3D Engine Data Reporting?
Author | Message | ||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1132 |
Is there other information available from the 3D engine? My search skills seem lacking. Can (could?) the engine report the centroid of a particular face in screen coordinates? And the angle (or better, the cosine of the angle) of a face to the camera? "1" would be exactly face on, "0" would be exactly on edge and "-1" would be exactly facing away. And while I'm dreaming, the angle in the plane of the screen the face is facing? For example, a face could be edge on to the camera - cos() = "0" to the viewer - and facing right, 0 degrees, or up, 90 degrees, etc. Maybe even the unit vector normal to a particular face. (My dreams, another's nightmare...) The bounds and/or the vertex coordinates of a particular face (in screen coordinates) would be useful too. Note the above wouldn't necessarily indicate if a given face is visible. Obviously if the cosine of the facing angle is negative, that face is pointing away from the camera and hence isn't visible, but some faces towards the camera could be obscured by nearer faces if the object is concave. The above features would be helpful for interacting with 3D objects on screen. For example, with the face centroids or vertex coords, I can determine where on the object the mouse is clicked. Visit Vegipete's *Mite Library for cool programs. |
||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1132 |
Another 3D engine question: Is there a way to change the colour of a face after a 3D object is created? At the moment, it looks like I have to close an object, update the array of face fill colours, then create the object again to lock in the new colours. Blech! Is there a better way? Visit Vegipete's *Mite Library for cool programs. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |