Marc Albrecht


About Me



My Tutorials

obj-image Quick Tips
Quicktip: Tearing Cloth Setup
obj-image Quick Tips
Using the Treeview for Rigging
obj-image Beginner
Walkthrough: Cloth Sim for a Movie Shot
obj-image Quick Tips
Getting Weightmaps into H16
obj-image Quick Tips
Wind for Cloth Sims in H16
obj-image Quick Tips
Adding a Flipbook Framecounter

Recent Forum Posts

3 point align of 2 similar meshes (like in Maya) Oct. 23, 2018, 3:03 p.m.

Hi, Olivier,

it's been ages that I used Photoscan (not because it's bad, but simply because of dev requirements) - so I cannot tell for sure if Photoscan has a world-lock-function like RealityCapture.

The idea is this: When you do photogrammetry, the points in space you get have no “origin”, even if you have a metric cube in your scanned scene, you first have to tell your pipeline, which points (on the cube) belong to the reference system. In RC this is what ground points are for: By defining points (2d on images, relating to 3d in the point cloud) to sit at given coordinates in your world space, the model you get “simply” gets rotated/scaled/transformed to that universe. Actually, it doesn't get transformed, it's just that the point coordinates are matched up.
In your case - with a rotating object - you'd need to adjust the reference (world space) accordingly, meaning, you'd need to rotate the rock in a “known way”, so that your ground points rotate along. I'm certain that photoscan has something like this “hidden somewhere”
Since this *should* be part of any photogrammetry pipeline that works with “interlocking” meshes (aligning from one scan to another or, bob beware, even combining Lidar with Ph*metry), aligning meshes - in theory - “is part of the process”.
(I say “in theory”, because in reality ph*metry comes with its own pitfalls in terms of large-model-precision (floating point issues, from my perspective, being the most likely reason).)


3 point align of 2 similar meshes (like in Maya) Oct. 21, 2018, 12:12 p.m.


haven't looked at the HIP (but will do ASAP), but:

> The result is 2 meshes of different scale/rotation/translation/topology.

… if you are using a tool like RealityCapture, this should not happen if your workflow is set up correctly. Groundpoints are used to make sure that your (arbitrary) local space gets mapped to a common global space correctly, so that (small) objects align pixel-perfect.
With large scale objects (landscapes of >400m with fine detail) the nature of photogrammetry may still introduce issues (lens calibration errors, floating point limitations etc), but everything that fits inside your room should be fine.


for(int i = 0; i < points; i++) explanation? Oct. 12, 2018, 3:14 a.m.


BabaJ's explanation is complete, but maybe a different wording helps, too …

“for” is one way of creating a loop. A loop is a block of program code that gets executed over and over again - usually, with start conditions being set, end conditions being checked and something being done after each iteration of the loop has ended.
In the case of “for”, these three components of a loop are defined as:

for ( Setup ; End-Condition-Check ; What-To-Do-After-Each-Run )

Setup: You do not NEED to set up anything, if you can check for something to have happened inside the loop. However, in most cases you want a loop to run a defined number of times, so you need a “timer”. The variable “i” is that timer. A timer has to start somewhere - you can either set it to your maximum number of runs/iterations (which would be the number stored in the variable “points”) here and then subtract 1 from your timer after each run of the loop OR you start at a given value (0 or 1, usually) and increase the timer after each iteration.
Saying “i=0” sets the timer to 0. It's 0, because in the computer world things start at 0, not at 1.
That's all the for-loop sets up in your case. You get a local (temporary) variable (your timer i) and after each run that timer is increased by 1 (the short form “i++” being lazy-programmers-make-it-look-like-magic speak) and compared against your end-definition.

End-Condition-Check: Before the iteration is run, this condition is being checked. Saying “i<points” will be a TRUE statement, as long as your timer “i” is smaller than the number in “points”, and FALSE once it is equal (or larger) than points. The loop will stop once the condition-check returns FALSE. As long as it returns TRUE, the loop will continue.
You could have a statement like “1==1” in that second part of the loop-definition. That comparison would always be true (1 always equals 1). So the loop would run indefinitely. You could BREAK it from inside the loop once some other condition is met.
You could have a statement like “1==0” in that second part of the loop-definition. That comparison would always be false (1 is never equal to 0), so the loop would NOT RUN, because BEFORE the iteration starts, this condition is checked and, being false, the loop would not be allowed to do anything.

What-To-Do-After-Each-Run: Once an iteration is done, the program code in this block is executed and the next iteration is started (if the end-condition-check returns true). Saying “i++” is the same as saying “i=i+1”. But since programmers are lazy AND want non-programmers to think that they “know things” and “can do magic”, they came up with a lot of crazy ways of typing things that no sane person would understand.
It's like learning how to understand women. It does not have to make sense, it's about accepting the facts of life and that some things are just … weird.
I digress.

I hope this, even though it is basically the same that BabaJ said, is of some help. If you like this style of explain-o-matic, check out my book about “how to become a programmer” []. It's not about VEX, but does say a lot of things about loops, variables, women and life.