Existing penalty-based haptic rendering approaches are based on the penetration depth estimation in strictly translational sense and cannot properly take object rotation into account. We propose a new six-degree-of-freedom (6-DOF) haptic rendering algorithm which is based on determining the closest-point projection of the inadmissible configuration onto the set of admissible configurations. Energy is used to define a metric on the configuration space. Once the projection is found the 6-DOF wrench can be computed from the generalized penetration depth. The space is locally represented with exponential coordinates to make the algorithm more efficient. Examples compare the proposed algorithm with the existing approaches and show its advantages.