Trouble with positioning using rotate / x,y,z coords of vertices

A central aspect of my app currently is the use of rotate() to create a spiral (using a series of vertices along an interpolation between two points). This is working beautifully, but only when point A and point B have no z value. When one has a z value, the rotation acts differently, and is still flush along the x axis. My problem here, I know, is how I am applying transformations, what transformations I’m applying, and how I am using push and popMatrix. Here is the code below (if I need to strip it down more I will try, it just seems very dependent on what I have here.)

http://pastebin.com/TwqvymU4

The main transformation is happening at line 229.

rotate is a function of ofVec3f so ofPush and popMatrix won’t have any effect over it. it’ll also won’t affect the following rotate calls anyway since it’s effects are contained in the specific ofVec3f you are calling it from so you don’t need to do anything special to contain the rotation to only that vertex.

Thanks @arturo . In that case, since I am just constructing my of3DPrimitive using functions of ofVec3f, what would be a way for me to change the slope of my shape? (Sorry this is becoming more and more difficult for me to explain). Without the rotation, the slope is correct between any two points. With the rotation, the rotation is definitely around the global x axis.

With rotation, everything seems to be centered along the x axis. This works exactly how I want it to when it comes to two points along x:

Without rotation, lines display correctly if they are lacking any z depth:

not sure what you are trying to do but probably you can apply some transformations to the vertices and then use the of3dPrimitive methods to apply any transformation that is the same for the whole mesh. fo example if you want to rotate the whole thing around it’s y axis you can call primitive.setOrientation(angle, ofVec3f(0,1,0)) or any of the other transformation methods in ofNode