View Issue Details

IDProjectCategoryView StatusLast Update
0030440CommunityOCCT:Visualizationpublic2019-05-26 10:48
ReporterVico Liang Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.8.0 
Target Version7.4.0Fixed in Version7.4.0 
Summary0030440: Visualization - Graphic3d_Camera::Frustum() returns wrong planes in portrait mode
DescriptionSix planes returned from Graphic3d_Camera::Frustum() are correct in landscape mode, while it's wrong in portrait mode. It's scaled some distance to screen center in portrait mode.
TagsNo tags attached.
Test case numberNot required

Attached Files

  • cadass_protrait.png (56,433 bytes)

Relationships

child of 0024413 closedabv Open CASCADE Visualization - get rid of projection shift from orthographic camera definition 

Activities

kgv

2019-05-22 13:16

developer   ~0084540

Could you please provide a reproducible scenario clarifying what is actually wrong?

Graphic3d_Camera has no platform-specific code, so I suppose the problem should be reproducible on desktop as well. I don't see anything unexpected with vertically stretched window in Draw Harness and vcamera command output.

kgv

2019-05-22 16:15

developer  

cadass_protrait.png (56,433 bytes)

Vico Liang

2019-05-23 05:26

developer   ~0084553

Please see my comment at the last two lines below, Aspect() > 1 condition is correct, the issue just occurs when Aspect() < 1.

void Graphic3d_Camera::Frustum (gp_Pln& theLeft,
                                gp_Pln& theRight,
                                gp_Pln& theBottom,
                                gp_Pln& theTop,
                                gp_Pln& theNear,
                                gp_Pln& theFar) const
{
  gp_Vec aProjection = gp_Vec (Direction());
  gp_Vec anUp = OrthogonalizedUp();
  gp_Vec aSide = aProjection ^ anUp;

  Standard_ASSERT_RAISE (
    !aProjection.IsParallel (anUp, Precision::Angular()),
     "Can not derive SIDE = PROJ x UP - directions are parallel");

  theNear = gp_Pln (Eye().Translated (aProjection * ZNear()), aProjection);
  theFar = gp_Pln (Eye().Translated (aProjection * ZFar()), -aProjection);

 // BUG HERE: if (Aspect() > 1.0)
  Standard_Real aHScaleHor = Scale() * 0.5 * Aspect();
  Standard_Real aHScaleVer = Scale() * 0.5;
  //else if(Aspect() < 1) Otherwise, the code should be
  Standard_Real aHScaleHor = Scale() * 0.5;
  Standard_Real aHScaleVer = Scale() * 0.5 / Aspect();

git

2019-05-23 12:04

administrator   ~0084556

Branch CR30440 has been created by kgv.

SHA-1: ae530f21ff3988752da8cee0b1dcbf07ca942f6f


Detailed log of new commits:

Author: kgv
Date: Thu May 23 12:02:29 2019 +0300

    0030440: Visualization - Graphic3d_Camera::Frustum() returns wrong planes in portrait mode
    
    Graphic3d_Camera::Frustum() now handles window Aspect Ratio < 1.0.

kgv

2019-05-23 12:06

developer   ~0084557

Well, these points are used nowhere in OCCT (V3d_View::FitMinMax() takes only directions), but, indeed, aspect ratio should be taken into account.

kgv

2019-05-23 13:27

developer   ~0084563

Last edited: 2019-05-23 13:27

Please take the patch.

http://jenkins-test-12.nnov.opencascade.com:8080/view/CR30440-master-KGV/

bugmaster

2019-05-23 15:45

administrator   ~0084572

Combination -
OCCT branch : CR30440
master SHA - ae530f21ff3988752da8cee0b1dcbf07ca942f6f
d67d4b811012eef8913d3c535c29654d0acf3c4c
Products branch : master SHA - 986f3b05d4ac9538c920d339cc6c45c66f97af3b
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 16329.970000000028 / 16353.149999999998 [-0.14%]
Products
Total CPU difference: 10514.79000000005 / 10547.03000000006 [-0.31%]
Windows-64-VC14:
OCCT
Total CPU difference: 17768.3125 / 17737.640625 [+0.17%]
Products
Total CPU difference: 12142.015625 / 12094.59375 [+0.39%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2019-05-26 10:48

administrator   ~0084627

Branch CR30440 has been deleted by inv.

SHA-1: ae530f21ff3988752da8cee0b1dcbf07ca942f6f

Related Changesets

occt: master a4d594cb

2019-05-23 09:02:29

kgv


Committer: bugmaster Details Diff
0030440: Visualization - Graphic3d_Camera::Frustum() returns wrong planes in portrait mode

Graphic3d_Camera::Frustum() now handles window Aspect Ratio < 1.0.
Affected Issues
0030440
mod - src/Graphic3d/Graphic3d_Camera.cxx Diff File

Issue History

Date Modified Username Field Change
2019-01-11 05:33 Vico Liang New Issue
2019-01-11 05:33 Vico Liang Assigned To => kgv
2019-05-22 13:16 kgv Note Added: 0084540
2019-05-22 13:16 kgv Assigned To kgv => Vico Liang
2019-05-22 13:16 kgv Status new => feedback
2019-05-22 16:15 kgv File Added: cadass_protrait.png
2019-05-23 05:26 Vico Liang Note Added: 0084553
2019-05-23 05:26 Vico Liang Assigned To Vico Liang => kgv
2019-05-23 05:27 Vico Liang Status feedback => assigned
2019-05-23 12:01 kgv Summary Visualization - Graphic3d_Camera::Frustum() return wrong in portrait mode for Android => Visualization - Graphic3d_Camera::Frustum() returns wrong planes in portrait mode
2019-05-23 12:04 git Note Added: 0084556
2019-05-23 12:06 kgv Note Added: 0084557
2019-05-23 12:07 kgv Relationship added child of 0024413
2019-05-23 12:08 kgv Product Version => 6.8.0
2019-05-23 13:27 kgv Note Added: 0084563
2019-05-23 13:27 kgv Assigned To kgv => bugmaster
2019-05-23 13:27 kgv Status assigned => resolved
2019-05-23 13:27 kgv Status resolved => reviewed
2019-05-23 13:27 kgv Note Edited: 0084563
2019-05-23 15:45 bugmaster Note Added: 0084572
2019-05-23 15:45 bugmaster Status reviewed => tested
2019-05-23 15:45 bugmaster Test case number => Not required
2019-05-25 19:58 bugmaster Changeset attached => occt master a4d594cb
2019-05-25 19:58 bugmaster Status tested => verified
2019-05-25 19:58 bugmaster Resolution open => fixed
2019-05-26 10:48 git Note Added: 0084627