17 March 2017 at 22 h 03 min #8803
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:
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 h 44 min #8818
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.
Hugo23 March 2017 at 22 h 24 min #8819
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:
It 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.
–Ruiliang24 March 2017 at 15 h 05 min #8822
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.
Hugo28 March 2017 at 21 h 06 min #8844
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.
It 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?
-Ruiliang28 March 2017 at 22 h 26 min #8845
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!
You must be logged in to reply to this topic.