Open hzeller opened 4 years ago
I suspect the angle-of-view different, i.e. the simulated camera in OpenSCAD is more 'wide-angle' ? If so, maybe it is possible to fish out the actual constants of the angle of views used for OpenSCAD.
The "#macro openscad_camera_angle(w ,h)
tries to calculate that, and it is dependent on the aspect ratio; possibly this calculation changed in OpenSCAD since the last update of openscad2povray. In particular my choice of rectangular aspect ratio highlit that discrepancy
With a different aspect ratio, now 1600x800, this looks like this:
OpenSCAD invocation with distance 500
openscad -D'$vpd=500' -D'$vpt=[-35, 29, 42]' -D'$vpr=[59.2, 0, 45.3]' radial6.scad
It looks vertically centered like before, just that there is now more space right and left due to double wide screen.
Povray echo generation with 1000 distance in initial bug entry. This now looks off.
openscad -Dopenscad_vpw=1600 \
-Dopenscad_vph=800 \
-D'$vpd=1000' \
-D'$vpt=[-35, 29, 42]' -D'$vpr=[59.2, 0, 45.3]' \
radial6.pov.scad -o radial6.pov.echo
Playing around with the OpenSCAD UI it seems that the angle is determined not from the ratio (which is what the openscad_camera_angle
macro uses to calculate the angle) but just from the height ? Changing the width of the window does not change the size of the output, just the vertical size does.
Once that is figured out, the openscad_camera_angle
macro can be adapted to match that.
Needs further investigation.
In order to get about the same size output, the distance (vpd) has to be doubled in Povray. Not sure if this is an artifact of different ways how to calculate the perspective, so leaving this here for exploration.
Example: here openscad invoked with the following parameters, most notably the
$vpd=500
This yields![distance-500-openscad](https://user-images.githubusercontent.com/140937/80435712-2d130980-88b2-11ea-8137-c92830a3fb0f.png)
(notice the distance is shown as 500 in the status bar)
In order to get the same view, I have to use the distance of 1000 (
$vpd=1000
or openscad_vpd=1000) when generating the echo file:.. which then creates the same frame![radial6](https://user-images.githubusercontent.com/140937/80435981-dbb74a00-88b2-11ea-964a-d8c7ed9fdf67.png)
Is there somewhere a factor of 2 off ?