Home › Forum › SOFA › Using SOFA › [SOLVED] Object disappearing in the frustum when I zoom in using Sofa v12.16
Tagged: 64_bits, SOFA_1608, Windows_10
- This topic has 5 replies, 2 voices, and was last updated 7 years, 7 months ago by Hugo.
-
AuthorPosts
-
17 March 2017 at 22:03 #8803ruiliangBlocked
Hi,
I have observed an bug when i using the latest sofa v12.16. When i zoom in, the objects start disappearing at a const speed. I have screen captured a short video below:
https://www.dropbox.com/s/niuzvum6fgtzhi1/error.gif?dl=0
P.S. This doesn’t happen when i run the same scene file using the older version of sofa(v 12.15).
Anyone know about this error?
Thanks in advance!
–Ruiliang23 March 2017 at 10:44 #8818HugoKeymasterHi Ruilang,
Thank you very much for this video that helps a lot!
It seems to be a problems related to the camera, and more especially to the params znear and zfar (actually znear mainly).Both znear and zfar are computated from the bounding box (BBox) of the scene, itself computed from your MechanicalObject. In your video, the value of znear seems to change change, which means that the BBox changes due to a moving MechanicalObject.
A quick fix would be to set yourself a fix value of the parameter bbox of your MechanicalObject, e.g.:
<MechanicalObject name="myMO" bbox="0 0 0 10 10 10" />
Let me know if this helps.
Cheers,Hugo
23 March 2017 at 22:24 #8819ruiliangBlockedHi Hugo,
Thank you very much for the feedback!
Unfortunately, this bug still exists even when i add the fixed bbox for every MechanicalObject in my scene.
I also tried printing out the znear and zfar values of the InteractiveCamera(p_zNear in the InteractiveCamera.cpp). The result is attached below:
https://www.dropbox.com/s/bldlnfy4800h1ha/error_znear.gif?dl=0It seems like the znear and zfar value keep increasing from the start of the animation. The above video shows that value increasing when i just moves the mouse.
–Ruiliang
24 March 2017 at 15:05 #8822HugoKeymasterHi Ruilang,
Indeed, something seems to move in your scene, thus affecting the bbox computation, i.e. visualization.
Could you share with us here your XML scene ?
If the value increases when you are moving the mouse, the problem might come from one of your draw() functions.
Best,
Hugo
28 March 2017 at 21:06 #8844ruiliangBlockedHi Hugo,
Thanks a lot!
I have noticed that there are some invisible objects flying in the scene that influences the BBox and zNear.
I have attached the screenshot below: In this scene, i am dragging an invisible point using the mouse. If i release the mouse, the invisible object will fly away and the minBBox, Znear starts changing. No matter which display flag i check(visual/collision/mechanical/mapping), the invisible object can not be visualized.
https://www.dropbox.com/s/yb4t0csmbs504a7/CutHex.png?dl=0It happens after i cut the hex mesh. It seems the hex mesh has some points remains after been cut. I wonder if there is something wrong with our hex mesh. I post one of the xml for the hexmesh below. We have “TriangleModel/LineModel/PointModel” for the collision model. What i found is even if i have just “TriangleModel” for the collision, it still has some points remain after cut.
<Node name=”Fatty tissue covering veins”> <HexahedronSetTopologyContainer hexahedra=”0 33 … <MechanicalObject name=”MO” rotation=”3.527953863143921 -2… <HexahedronSetTopologyModifier removeIsolated=”false” /> <HexahedronSetTopologyAlgorithms template=”Vec3d” /> <HexahedronSetGeometryAlgorithms template=”Vec3d” /> <DiagonalMass /> <HexahedronFEMForceField damping=”0.10000000149011612″ method=”large” poissonRatio=”0.4000000059604645″ rayleighStiffness=”0.10000000149011612″ youngModulus=”3000.0″ /> <UncoupledConstraintCorrection /> <Node name=”quad-surface”> <QuadSetTopologyContainer name=”Fatty tissue covering veins-quadSurf” /> <QuadSetGeometryAlgorithms template=”Vec3d” /> <QuadSetTopologyModifier /> <QuadSetTopologyAlgorithms template=”Vec3d” /> <Hexa2QuadTopologicalMapping input=”@../Fatty tissue covering veins-topology” output=”@Fatty tissue covering veins-quadSurf” /> <OglShader fileFragmentShaders=”… <OglFloatVariable name=”TessellationLevel” value=”8″ /> <OglModel genTex3d=”1″ material=”Default Diffuse 1 0.12459243 <IdentityMapping input=”@../MO” output=”@Fatty tissue covering veins-visual” /> <Node name=”triangle-surface”> <TriangleSetTopologyContainer name=”Fatty tissue covering veins-triSurf” /> <TriangleSetTopologyModifier /> <TriangleSetTopologyAlgorithms template=”Vec3d” /> <TriangleSetGeometryAlgorithms template=”Vec3d” /> <Quad2TriangleTopologicalMapping input=”@../Fatty tissue covering veins-quadSurf” output=”@Fatty tissue covering veins-triSurf” /> <!– <PointModel bothSide=”0″ contactFriction=”500.0″ contactStiffness=”50000000.0″ group=”1″ moving=”1″ selfCollision=”0″ simulated=”1″ /> –> <LineModel bothSide=”0″ active=”0″ contactFriction=”500.0″ contactStiffness=”50000000.0″ group=”1″ moving=”1″ selfCollision=”0″ simulated=”1″ /> <TriangleModel bothSide=”0″ contactFriction=”500.0″ contactStiffness=”500.0″ group=”1″ moving=”1″ selfCollision=”0″ simulated=”1″ tags=”HapticSurface” /> </Node> </Node> </Node>
Can you help me look at this?
Thanks!-Ruiliang
28 March 2017 at 22:26 #8845HugoKeymasterHi Ruilang,
It means there is any issue with the handling of topological changes. It might come from the TriangleSetTopologyModifier. I am really not an expert in this area. I’ll try to investigate or find someone who can have a look. Let us know if you solve your issue!
Best,
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.