How to manipulate z-ordering of sheets

Mar 27, 2013 at 5:50 PM

I have a problem, I'm manipulating the perspective's features for allow me to see the scene from different point of view,, it's work fine, but this feature forced me to create objects with five sheets (front, side, top, two behind sheets) instead of three (front, side, top), but when the camera is behind an object, the front sheets are displaying over the back sheets.

So, how can i manipulating the z-ordering easely or not ?!
Mar 27, 2013 at 5:59 PM
Z-ordering is automatic and relies on the
vector. If you update this vector according to the camera position, you should get correct results, and the sheets at the back should be displayed in the front. Let me know if this does not work for you.
Mar 27, 2013 at 6:28 PM
Cool, Thank you, it's work !!
Jul 2, 2014 at 3:56 PM

I have got a similar problem. Currently I am working on a configurator for sofas. And I would like to use sheetengine for the isometric visualization.

I have the following problem:
I tried to build different views that allow the user to look from different perspectives to the scenery.
Depending on how sofa-parts are placed and rotated the Z-ordering is not working.
For example here:
The texture is not loaded the first time. Please click on the button [isofront] to redraw the scene.

I read that z-ordering is automatic and relies on the sheetengine.viewSource vector.
First I thought that something must be wrong with my viewSource vectors, but than I recognized that the build-in view does not work correct.
I put some boxes/frames on the stage to demonstrate the problem:
  1. The boxes in front are rendered correct. There is a space of 5 between the boxes.
  2. The boxes in the middle have got problems at their right side. The difference to 1. is that the space between the boxes is 4 now
  3. The last row of boxes has got problems at top, bottom and right side. They have got a depth 18 instead of 40 now and there is a space of 4.
Is this a problem with the heetengine.viewSource vector?
What would be the correct code to switch between the views [isofront] [isoright] [isoback] [isoleft] of the first example?

Thank you,
Jul 2, 2014 at 5:14 PM
No, it's not likely to be a problem of the viewsource vector. It's probably the result of some optimizations sheetengine uses in order to make z-ordering faster. Shortly, the way it works to decide which one from 2 sheets should be drawn first is that it sets off some rays in the direction of the viewsource and checks the intersections of the rays and the sheets. From the z-value of intersection points it decides which sheets to draw first. An infinite number of rays would give us the optimal solution, but that would take forever. Also, the distance <5 can be accounted for optimizations to fix some graphic glitches in games, that might not be specifically useful to you.

So here are some suggestions, to play with:

line 1291: use a lower value for zOrderDistanceThreshold
line 1295: use a lower value for zOrderDistanceThreshold
line 757: this is where the number of rays to shoot is defined. The array defines different number of rays (numpoints) for different line segment lengths (dist). Start experimenting with something like [{dist:0, numpoints:100}]. It's going to be slow, but probably give you more accurate results.
Jul 3, 2014 at 1:39 PM
Thank you for the quick reply.
It is slower now, but it works for me. I do not need real time visualization.

I will send you the link to the project when it is launched.
Great engine, excellent support!
Feb 10, 2015 at 3:32 PM
It took a while but finally we went online. I am proud to present you the configurator we worked on the last month.
The part of the 3D visualization is managed by the sheet engine.
Please use the “View in 3D” button to see the sheet engine working:

Thanks again!


Feb 10, 2015 at 3:48 PM
I've checked it out, it's pretty cool! I like it :) Nice work!