SetTransformPersistence strange and unwanted behavior in 7.5.0

fpelloni's picture

Hello
I have found a strange and unwanted behavior in visualization component in version 7.5.0, while up to 7.4.0 it was OK.
I'm talking about trihedron kind of TransformPersistence.

You can set TransformPersistence for an object at a defined x,y distance from each corner of the view, and it shows it correctly until a certain view hight/width ratio.

Then, furtherly reducing the height of the view, the rotation point of the object start migrating to the center of the view.

This is what happens also in CAD Builder program reducing window height:
https://freeimage.host/i/KaDQoX
https://freeimage.host/i/KabHR2
https://freeimage.host/i/Kab9Hl

and the same in DRAWEXE:
pload ALL
vinit
box b 100 50 10
vdisplay b
vtrihedron tri
vdisplay -trsfPers trihedron -trsfPersPos -20 -20 -2d tri
https://freeimage.host/i/K0mhiP
https://freeimage.host/i/K0mXWB
https://freeimage.host/i/K0mWxV
(I was not able to let Draw accept the -20,-20 offset from corner, but the issue is well visible)

So, as until a certain view dimension ratio it works correctly, it's not a problem of persistence flag setting
but of runtime calculus of the position of object.

I can't find this issue in ISSUE TRACKER!

I've tried to look for possible origin of the problem, looking also at source differences from 7.5.0 and 7.4.0 from View3d_View.cxx to Graphic3d_TransformPers.hxx to OpenGL_Structure.cxx but don't understanding exactly at what level this is managed I couldn't work it out!
Any hint?

Regards,
Federico Pelloni

kgv's picture

fov2d

Hello Federico,

interesting catch.

The new behavior has been introduced in OCCT for supporting VR displays #0029384 having extreme FOV angles, but with only portion of this FOV clearly readable (due to lenses distortion, non-uniform pixels density and too wide angle for a human eye).

The working area for displaying trihedrons and other 2D objects is now clipped by parameter called Graphic3d_Camera::FOV2d(). By default, this parameter is set to 180 degrees, which means that you see trihedron floating from window corner when camera aspect ratio exceeds 180 degrees limit.

Practically speaking, this is quite a large limit, and this might cause an issue only in case of abnormal Width x Height window proportions (very narrow height or window resized to 2+ horizontally-stacked wide monitors). So, I have some doubts if this is an issue in practice, or just an unexpected behavior while playing with window.

In Draw Harness you can play with this parameter via "vcamera -fov2d" command:

pload MODELING VISUALIZATION
vinit View1 -width 1600 -height 150
box b 100 50 10
vdisplay b
vzbufftrihedron
vcamera -fov2d 1000
fpelloni's picture

Thanks for the prompt

Thanks for the prompt answer.

> "....I have some doubts if this is an issue in practice"

Well, it depends on the application:
our CAM that work on long pieces has usually a bottom window that gives the customer a side view of the piece.

And this is the result with 7.5.0:
https://freeimage.host/i/KE4O1j

I had suspects VR/OpenXR was involved, but didn't catch that 2D objects can have a different FOV and I was thinking it was a bug.

Ok, I'll try to play with camera FOV2d.

Thanks,
Federico Pelloni

Federico Pelloni
Emmegisoft s.r.l.

www.opencascade.com

Copyright 2011-2020
OPEN CASCADE SAS
Contact us