How to put model between points

Hi!

I’m new to panda3d and 3d :slight_smile:
I have maybe a simple question but i can’t find anwser. Let’s say I have model of cylinder in egg file and 2 points- Point3f (x,y,z coordinates). Is there a simple way for putting my cylinder between this points, and if cylinder is to small or large- scale it?

make sure your cylinder has a length of one unit. and the bottom is at the model root’s center.

do a
yourcylindernode.setPos(x1,y1,z1)
yourcylindernode.lookAt(x2,y2,z2)
yourcylindernode.setScale(1,1, distanceBetweenPoints)

where you can get the distance by manually calculating or by subtracting the 2 vec3’s and do a getLength() on the result.

i am not sure how you may need to rotate the zylinder in your editor, maybe you need to make it point along the x-axis and set the x-scale accordingly to the distance, instead of the z-component.