flopoloco's picture

Vector3 troubles!

Hi there, how can I convert this piece of code to C#/OpenTK? I have troubles porting Cross and Normalize methods... (Oh boy, do I suck in coding or what ;-) )

Vec3f sum;
Vec3f out;
Vec3f left;
sum += out.cross(left).normalize();

c++ code zip file


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

Try using the static methods like this:

Vector3 sum = new Vector3();
Vector3 out = new Vector3();
Vector3 left = new Vector3();
 
sum += Vector3.Normalize(Vector3.Cross(out, left));
flopoloco's picture

Thanks for the help!