|
Sweet Home 3D Forum » List all forums » » Forum: Developers » » » Thread: Mapping Floor Plan Coordinates to Render/3DView Coordiantes » » » » Post: Re: Mapping Floor Plan Coordinates to Render/3DView Coordiantes |
Print at Dec 15, 2025, 11:32:21 PM |
| Posted by Daniels118 at Dec 25, 2023, 9:54:44 PM |
|
Re: Mapping Floor Plan Coordinates to Render/3DView Coordiantes Yes, the output coordinates are relative to the 3D view. As long as the rendering uses the same proportions as the 3D view, computing the pixel coordinates is just a matter of applying a scaling factor (factor = render_width / view3d_width). But to cover all rendering options (different proportions, different lenses), you have to compute the right projection matrix. I think that you could find the relevant code in the classes that implement the rendering. Once you have the projection matrix you can use it to transform 3D coordinates to screen coordinates (I remember that the official doc for Java3D has pratical examples of how it works, but any lecture about 3D projection works as well), and finally apply the scaling factor to get the exact pixel location. I'm not sure that a projection matrix can cover spherical lenses too, but I guess that a quick web search should answer the question. |
|
|
Current timezone is GMT Dec 15, 2025, 11:32:21 PM |