1
Python and Java API / Use of pickPoint() in order to create marker
« on: June 08, 2018, 03:23:27 PM »
Hello,
I want to pick points on my model.
I know the coordinates of points, when I place them by addMarker() function, they are at the right place, but if I reference my model, they leave I don't know where. I supposed that is because they are not really on the model but just beside. The idea is to get the point on the model. So I've found the pickPoint() function.
But when I try to use it, my point doesn't appear at the right place at all (It is not even on the model ...)
Can somebody help me please ?
I know the coordinate of my point because I pick it in another software.
v2 is the ray origin (here the coordinate of the camera when I pick point in my other software)
v3 is my point
I want to pick points on my model.
I know the coordinates of points, when I place them by addMarker() function, they are at the right place, but if I reference my model, they leave I don't know where. I supposed that is because they are not really on the model but just beside. The idea is to get the point on the model. So I've found the pickPoint() function.
But when I try to use it, my point doesn't appear at the right place at all (It is not even on the model ...)
Can somebody help me please ?
I know the coordinate of my point because I pick it in another software.
v2 is the ray origin (here the coordinate of the camera when I pick point in my other software)
v3 is my point
Code: [Select]
v2 = PhotoScan.Vector([float(tabResetSrcO[idM][0]), float(tabResetSrcO[idM][1]), float(tabResetSrcO[idM][2])])
v3 = PhotoScan.Vector([float(srcP[0]), float(srcP[1]), float(srcP[2])])
p = chunk.model.pickPoint(v2,v3)
if(not(p is None)):
m = chunk.addMarker()
m.label = myOwnLabel
m.reference.location = p