It is known that humans recognize objects using combinations and positional relations of primitive shapes. The first step of such recognition is to recognize 3D primitive shapes. In this paper, we propose a method for primitive shape recognition using superquadric parameters with a metric learning method, large margin nearest neighbor (LMNN). Superquadrics can represent various types of primitive shapes using a single equation with few parameters. These parameters are used as the feature vector of classification. The real objects of primitive shapes are used in our experiment, and the results show the effectiveness of using LMNN for recognition based on superquadrics. Compared to the previous methods, which used k-nearest neighbors (76.5%) and Support Vector Machines (73.5%), our LMNN method has the best performance (79.5%).