The triangle is the second major attack I use from s-mount. Here is one way of getting it that works off the same grip as I use to take the armbar.

I am trapping the near arm for the armbar (hugging my hip, elbow to elbow), and Trog is defending like always. With my right hand, I grab his far wrist and shove it down and away from me.

As I push his arm down, I throw my right leg over the arm.

I bring my right leg towards his head, trying to get my calf on his neck and my foot behind his head.

I lean towards his far hip, posting on the mat for balance. I base on my right knee as I bring my leg deeper around his head and neck.

I triangle my legs and come back to center for a mounted triangle.

Now for some troubleshooting. An opponent who is wise to the triangle will often try to defend it by not letting the leg pass over their far arm.

Here we see me going for the triangle but Trog is holding his wrist and trying to keep his far arm inside so I can't get the triangle.

I wedge my right hand in the exposed bend of his elbow.

I drive my arm through as deeply as I can.

I remove the arm completely by prying it out by pulling their arm and opening my elbow. From here, just continue with the triangle like usual.

That's not all the trouble we'll get though. Another common defense is to try to do a backdoor escape as the leg passes over. Here is a re-counter that picked up from David Camarillo's new book, as well as Jean-Jacques Five Favorite Finishes video (though he does it from guard).

As I go for the triangle, Trog grabs my leg with his outside arm and tries to shove it over his head as he scoots out the back.

I keep my hold on his near arm so he doesn't pull out all the way. My right leg comes to the near side of his head.

I throw my left leg over their head.

And fall back to finish a very tight armbar.