Hello,
I'm trying to convert some vb.net code (that works) to c# code. I'm having a bit of trouble with the following.
1st is the vb.net code that gives me no trouble.
2nd is the c# code that gives me the errors.
3rd are the errors thrown by Visual Studio 2010.
Thank you in advance for any assistance you can offer.
Dim oZVector As UnitVector = oTG.CreateUnitVector(oViewCamera.Eye.X - oViewCamera.Target.X, _
oViewCamera.Eye.Y - oViewCamera.Target.Y, oViewCamera.Eye.Z - oViewCamera.Target.Z)
Dim oYVector As UnitVector = oViewCamera.UpVector
Dim oXVector As UnitVector = oYVector.CrossProduct(oZVector)
Dim oTransMatrix As Matrix = oTG.CreateMatrix
oTransMatrix.SetCoordinateSystem(oTG.CreatePoint(0, 0, 0), oXVector.AsVector, oYVector.AsVector, oZVector.AsVector)
Here is the c# code that doesn't work.
UnitVector oZVector = oTg.CreateUnitVector(viewCamera.Eye.X-viewCamera.Target.X, viewCamera.Eye.Y - viewCamera.Target.Y, viewCamera.Eye.Z - viewCamera.Target.Z); UnitVector oYVector = viewCamera.UpVector; UnitVector oXVector = oYVector.CrossProduct(oZVector); // Create a matrix. Matrix transMatrix = oTg.CreateMatrix(); *Error 5* transMatrix.SetCoordinateSystem(oTg.CreatePoint(0, 0, 0), oXVector.AsVector, oYVector.AsVector, oZVector.AsVector);
Here are the errors I keep getting.
Error 5 The best overloaded method match for 'Inventor.Matrix.SetCoordinateSystem(Inventor.Point, Inventor.Vector, Inventor.Vector, Inventor.Vector)' has some invalid arguments
Error 6 Argument 2: cannot convert from 'method group' to 'Inventor.Vector
Error 7 Argument 3: cannot convert from 'method group' to 'Inventor.Vector
Error 8 Argument 4: cannot convert from 'method group' to 'Inventor.Vector
Solved! Go to Solution.
Solved by herrwolf1. Go to Solution.
problem solved:
transMatrix.SetCoordinateSystem(oTg.CreatePoint(0, 0, 0), oXVector.AsVector(), oYVector.AsVector(), oZVector.AsVector());