Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:11 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2: 3D Engine Data Reporting?

Author Message
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 06:16pm 18 May 2021
Copy link to clipboard 
Print this post

  matherp said  You can establish the bounding rectangle using the functions draw3d(XMAX n) etc.


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: Canada
Posts: 1132
Posted: 05:24am 05 Jun 2021
Copy link to clipboard 
Print this post

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.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025