code to convert Java version scene to C++ version scene