ivan.cuevas Posted January 27, 2015 Share Posted January 27, 2015 Hi all, I'm trying to integrate LeapMotion in Unigine. First question is if Ungine plans to support this device in the near future. I don't want to spend time in something that is already in the Unigine kitchen. Second question is about coordinates conversion. LeapMotion and Unigine uses right-handed coordinated system but up is Y axis in LeapMotion. I want to find the fastest way to make these conversions (for Vector and Matrix types) because every frame hands and fingers parts must updated in Unigine environment. Thanks. Link to comment
silent Posted January 27, 2015 Share Posted January 27, 2015 Hi Ivan, First question is if Ungine plans to support this device in the near future. I don't want to spend time in something that is already in the Unigine kitchen. We don't have plans for LeapMotion integration. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
unclebob Posted January 27, 2015 Share Posted January 27, 2015 Hey, Iván Regarding your second question, for vectors it's super easy: vec3 leapmotion_data; // data from leapmotion where y is up // Common way vec3 unigine_data = vec3(leapmotion_data.x,leapmotion_data.z,leapmotion_data.y); // In UnigineScript it could be even shorter by using swizzles vec3 unigine_data = leapmotion_data.xzy; For matrices it's just a matter of swapping rows/columns inside matrix: mat4 leapmotion_data; // data from leapmotion where y is up // if the leapmotion matrices are row-major then you have to transpose them as unigine matrices are column-major order (like OpenGL) mat4 unigine_data(leapmotion_data,1); // set this if leapmotion_data matrix is in row-major order // C++ common way (swap two zy axes) mat4 unigine_data; unigine_data.setColumn(0,leapmotion_data.getColumn(0)); unigine_data.setColumn(1,leapmotion_data.getColumn(2)); unigine_data.setColumn(2,leapmotion_data.getColumn(1)); unigine_data.setColumn(3,leapmotion_data.getColumn(3)); // C++ faster way (swap data inside the matrix itself) mat4 unigine_data = mat4(leapmotion_data); swap(unigine_data.m10,unigine_data.m20); swap(unigine_data.m11,unigine_data.m21); swap(unigine_data.m12,unigine_data.m22); swap(unigine_data.m13,unigine_data.m23); 1 Link to comment
ivan.cuevas Posted January 27, 2015 Author Share Posted January 27, 2015 Thanks for the quick answers. Link to comment
jwill Posted June 2, 2015 Share Posted June 2, 2015 @ivan.cuevas did you actually manage to integrate LeapMotion in Unigine? Link to comment
ivan.cuevas Posted June 9, 2015 Author Share Posted June 9, 2015 Unfortunately this integration has a lower priority for us, it's stopped for the moment. Link to comment
Recommended Posts