Fixed primitive shape type not set for segment mode. Also fixed bad cast with model matrix. Rotation still an issue.