.NET

Reply
Valued Contributor
Posts: 98
Registered: ‎06-22-2007
Message 1 of 2 (173 Views)

Matrix3d Help.

173 Views, 1 Replies
07-06-2012 09:51 AM
I'm trying to Align the Z Axis with 2 points, that works but I'm 90deg off around the Z Axis any help would be appreciated

Shared Function UCSAlignZaxix(ByVal Point1 As Point3d, ByVal Point2 As Point3d) As Matrix3d

        Try
            Dim ZAxis As Vector3d = Point1.GetVectorTo(Point2).GetNormal
            Dim yAxis As Vector3d = ZAxis.GetPerpendicularVector.GetNormal
            Dim xAxis As Vector3d = yAxis.CrossProduct(ZAxis).GetNormal

            Dim NewMatrix3d As Matrix3d = Matrix3d.AlignCoordinateSystem(Point3d.Origin, Vector3d.XAxis, Vector3d.YAxis, Vector3d.ZAxis, Point1, xAxis, yAxis, ZAxis)

            Return NewMatrix3d
        Catch
            Return Nothing
        End Try
    End Function
Valued Contributor
Posts: 98
Registered: ‎06-22-2007
Message 2 of 2 (163 Views)

Re: Matrix3d Help.

07-06-2012 11:11 AM in reply to: wowens63

got it working

 

Dim ZAxis AsVector3d= Point1.GetVectorTo(Point2).GetNormal

 

Dim XAxis AsVector3d= ZAxis.GetPerpendicularVector.GetNormal

 

Dim YAxis AsVector3d = ZAxis.CrossProduct(XAxis).GetNormal

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community