15,898,770 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by paulrm (Top 3 by date)
paulrm
17-Nov-14 5:53am
View
Thanks Andi,
I was aware the calculations were not commutative. I had determined the 1st and 3rd steps in the sequence and had just theorized the 2nd, but have not tried it yet. Your solution matches my theory.
I'll put it into practice after work today and see if it is in fact the solution I was looking for.
I am able to visualize the required steps, but I am not a math wizard and so the equations do not come easily to me.
Thanks again.
paulrm
16-Nov-14 19:00pm
View
I was pretty sure the above matrix would be close, but it does not work. The translation is correct, but the rotation is not.
Here's my effect.World line from the Draw function;
effect.World = (absoluteTransforms[mesh.ParentBone.Index] * rotation) * translation * camera.World;
Any help will be greatly appreciated.
paulrm
15-Nov-14 21:58pm
View
The 3 points are defined within the model and are transformed by the matrix given. They could be any 3 points from a mesh within the model. The plane is arbitrary. It can and will change.
I want to align the 3 axes, of an object with a base centered at Vector3.Zero, to the 3 axes of the plane.
The answer will probably be something like;
Matrix rotation = Matrix.CreateRotationX((float)Math.Acos(Vector3.Dot(plane.Normal, Vector3.Right))) * Matrix.CreateRotationY((float)Math.Acos(Vector3.Dot(plane.Normal, Vector3.Up))) * Matrix.CreateRotationZ((float)Math.Acos(Vector3.Dot(plane.Normal, Vector3.Forward)));