Paul.Brodin Posted January 23, 2015 Share Posted January 23, 2015 Hi there Still quite new to Unigine, but making some progress in using a c# application to programatically build some worlds. Ive managed to use the PlayerDummy to create some static camera locations, but i cant figure out what the syntax is to set the direction of the camera (i can position it, but it just looks straight down) I am guessing that i need to rotate the matrix passed into the setWorldTransform function, but cant figure it out, ive found some c++ samples but still cant get it figured out. i have this myCam.setWorldTransform(MathLib.translate(new Vec3(dx, dy, dz + dHgt))); To set the location. Anyone help with what is next? Link to comment
unclebob Posted January 23, 2015 Share Posted January 23, 2015 Hey Paul, You can use setTo (https://developer.unigine.com/en/docs/1.0/scripting/core/math.matrix#setTo_variable_variable_vec3) function to set camera position as well as direction. Something like that: Vec3 position = new Vec3(10, 10, 10); Vec3 eye_point = new Vec3(0, 0, 0); Vec3 up = new Vec3(0, 0, 1); myCam.setWorldTransform(MathLib.setTo(position, eye_point, up)); Link to comment
Paul.Brodin Posted January 24, 2015 Author Share Posted January 24, 2015 Brill - thats just what i was missing - the setTo function is part of the MathLib ! Link to comment
Recommended Posts