Could it have something to do with the yaw rotation applied to the fences? Or perhaps something to do with the order of transformations applied to the fence segments.
I am sorry I was not able to reply sooner, but another way to approach the original problem is to consider that a 3x3 transformation matrix is composed of three X, Y, Z basis vectors, and the xyz coordinates of the model are essentially weightings of these vectors to produce the transformed position. If the fence model goes along the X axis, this means you could compose a matrix like so:
\begin{bmatrix}
1 & 0 & \frac{z}{w} \\
0 & 1 & 0 \\
0 & 0 & 1 \\
\end{bmatrix}
…where z is the amount by which to lift the fence (relative to the origin of the fence) and w is the width of the fence. This means that the local z coordinate of a given position in the model will be increased by this factor of the local x coordinate.
Here is a small sample.
from panda3d.core import *
from direct.directbase import TestStart
base.cam.set_y(-150)
# Fence segments are 30 units wide in x, 15 units high in z
cm = CardMaker('card')
cm.set_frame(0, 30, 0, 15)
card1 = render.attach_new_node(cm.generate())
card1.set_color((1, 0, 0, 1))
card1.set_mat(Mat4(Mat3(
# Next fence has z of 10, so the right edge of this is skewed up by 10
1, 0, 10 / 30,
0, 1, 0,
0, 0, 1,
), card1.get_pos()))
card2 = render.attach_new_node(cm.generate())
card2.set_color((0, 1, 0, 1))
card2.set_pos(30, 0, 10)
card2.set_mat(Mat4(Mat3(
# Next fence has z of -10, this one has z of 10,
# so the right edge of this one is skewed down by 20
1, 0, -20 / 30,
0, 1, 0,
0, 0, 1,
), card2.get_pos()))
card3 = render.attach_new_node(cm.generate())
card3.set_color((0, 0, 1, 1))
card3.set_pos(60, 0, -10)
base.run()