• Home
  • Products
    • Game Engine
      • Base
      • Mathematics
      • Geometry
      • Physics
      • Particles
      • Animation
      • Graphics
      • Game
      • Game UI
    • Windows Forms
      • Docking Windows
      • Text Editor Control
  • Downloads
  • Buy
    • Overview
    • Professional
    • Indie
    • Non-Commercial
  • Support
    • Overview
    • Blog
    • Forum
    • License FAQ
    • Documentation
  • About
    • About Us
      • Services
    • Contact Us
    • Press
    • Legal Terms
      • Imprint (English)
      • Imprint (German)
Select the search type
 
  • Site
  • Web
Search
DigitalRune.com
Login |Register
NEWS News RSS Feed BLOG Blog RSS Feed FORUM News RSS Feed DOCUMENTATION DigitalRune Software on YouTube DigitalRune Software on Twitter
You are here: SupportForum

If you want to contribute to the forum discussions, please Register or Login.

SearchHome
  • 1
  • 2
  • 3
  • 4
  • 5
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineOrientation - GetTangent()Orientation - GetTangent()
Previous
 
Next
New Post
1/11/2012 11:23 AM
 
x35mm
No Ranking

Joined: 1/11/2012
Posts: 2
Orientation - GetTangent() 

Hi guys,

First off, just wanted to say that really impressed with the libraries. I'm not too good when it comes to 3D but working with your stuff has been pretty easy so far, even for me! Currently using the 30 day trial but very tempted to purchase an indie license come payday.

I've been working on a simple slotcar style game, and so far it's been great. I'm using a Path3F and getting the position is fine, using GetParameterFromLength();

Using GetTangent() it returns a Vector3F. To create a new Pose it requires a Vector3F for Position, and then a QuaternionF or Matrix33F for Orientation. 

Using QuaternionF.CreateRotation() it requires a Vector3F, and then a float for the angle.

How do I get the angle from GetTangent()? The documentation just says to use GetTangent() but doesn't give any examples, so I'm guessing it's a pretty simple thing, it's just got me stuck.

Thanks a bunch!



 
New Post
1/11/2012 12:09 PM
 
HelmutG
6th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 565
Re: Orientation - GetTangent() 

Welcome! Glad you are finding our libs useful ;-)

Helpful documentation and samples for paths:
- Article "How To: Move Objects on a 3D Path" in the DigitalRune Mathematics documentation. (I guess you have already found this.)
- "Sample 04 - Kinematic on path" in the DigitalRune Physics General Samples solution.

In the sample a cone is moved on a path. The forward vector of the cone (in the local cone space) is (0, 1, 0). Now, we need the orientation which rotates the local forward vector to the tangent direction. For the cone sample this is simply:

Vector3F forward = _path.GetTangent(parameter).Normalized;
QuaternionF targetOrientation = QuaternionF.CreateRotation(Vector3F.UnitY, forward);

 

This should work for simple cases. In general, computing a stable orientation for movement along a path is actually a non-trivial problem. If the path goes up/down and the car should always be aligned to a certain ground plane, then you might need a more sophisticated solution. In this case let us know.

 
New Post
1/11/2012 12:16 PM
 
x35mm
No Ranking

Joined: 1/11/2012
Posts: 2
Re: Orientation - GetTangent() 

Ah I forgot about the other samples, I only looked at the documentation!

Thanks very much! =)

 
 Page 1 of 1
Previous
 
Next
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineOrientation - GetTangent()Orientation - GetTangent()


DigitalRune is a trademark of Garstenauer Information Technology OG.

Garstenauer Information Technology OG
Weingartenstrasse 35, 4452 Ternberg
Austria (EUROPE)
office@digitalrune.com

Home Products Downloads Buy Support About Us
Game Engine Particles Windows Forms Professional Blog Services
Base Animation Docking Windows Indie Forum Contact Us
Mathematics Graphics Text Editor Control Non-Commercial License FAQ Press (News)
Geometry Game Documentation Legal Terms
Physics Game UI Imprint
Impressum
Copyright © 2006-2012 Garstenauer Information Technology OG Terms Of UsePrivacy Statement