Problem: twisted extrusion

When I coded extrusion using the algorithm in VRML 97 specification, I got twisted extrsusion. Did anyone have the same problem? How to solve it. Thanks in advance.