Game Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesGame Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old January 25th, 2007, 12:27 AM
jorgejones jorgejones is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 134 jorgejones Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 1 Day 4 h 58 m 35 sec
Reputation Power: 0
Converting onto XYZ from vector, need help.

Hello people.

I have a vector that defines a rotation in degrees.
I must transform this onto XYZ (supposedly: world) so I can properly apply an impulse using a physics engine.

How can I do this?.
I'm stuck!.

Shorter question: How can I transform a vector onto XYZ components, if the vector defines a rotation angle in degrees.

My vector magnitude is used as a "power" multiplier for the final impulse, I think this can be left alone on the actual computation of the XYZ components.


Thanks in advance

Reply With Quote
  #2  
Old January 25th, 2007, 01:35 AM
jorgejones jorgejones is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 134 jorgejones Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 1 Day 4 h 58 m 35 sec
Reputation Power: 0
I forgot to add: I'm using SIN and COS right now, however I was seeking for a more optimized solution. Sorry for not adding this on the original post.

I hope I'm making some sense here.

Reply With Quote
  #3  
Old February 3rd, 2007, 08:57 PM
Taqwus Taqwus is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 80 Taqwus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 30 m 57 sec
Reputation Power: 6
Send a message via Yahoo to Taqwus
if you are using cyclidrical coordinates, R = length and W (theta) = angle
then X (or adjacent angle) = R Cos W
and Y (or opposite angle) = R Sin W
If you are using spherical coordinates it is different

Reply With Quote
  #4  
Old February 4th, 2007, 03:07 PM
BioSlayer's Avatar
BioSlayer BioSlayer is offline
C# Addict.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Earth
Posts: 283 BioSlayer User rank is Sergeant (500 - 2000 Reputation Level)BioSlayer User rank is Sergeant (500 - 2000 Reputation Level)BioSlayer User rank is Sergeant (500 - 2000 Reputation Level)BioSlayer User rank is Sergeant (500 - 2000 Reputation Level)BioSlayer User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 8 h 52 m 11 sec
Reputation Power: 22
Take a look at this link.
http://mathworld.wolfram.com/EulerAngles.html
You should have learned this stuff in school though.
__________________
There are none so blind as those who will not see. — Jonathan Swift

My 2D Physics Engine.
My Remake of UQM.
Both are written in C#.

Reply With Quote
  #5  
Old March 2nd, 2007, 07:52 AM
MassKiller MassKiller is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 8 MassKiller User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 44 m 28 sec
Reputation Power: 0
Quote:
Originally Posted by BioSlayer
Take a look at this link.
http://mathworld.wolfram.com/EulerAngles.html
You should have learned this stuff in school though.


If you plan on using a matrix to transform the vector using trigonomic operations, its HIGHLY recommended that you create something known as a Trigonomic Lookup Table, which contains basically an array of floating point numbers containing the results of a sin or cosine operation. Then the only magic is figuring out how the shift the array access index by 1/4 that of a full circle.

This is important to bear in mind that trigonomic operations basically kill the CPU, looking up a predefined trigonomic value is much more efficient.

Reply With Quote
  #6  
Old March 15th, 2007, 07:16 PM
jwdonahue jwdonahue is offline
Bellevue WA, USA
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2004
Location: Bellevue Washington, USA
Posts: 1,038 jwdonahue User rank is Second Lieutenant (5000 - 10000 Reputation Level)jwdonahue User rank is Second Lieutenant (5000 - 10000 Reputation Level)jwdonahue User rank is Second Lieutenant (5000 - 10000 Reputation Level)jwdonahue User rank is Second Lieutenant (5000 - 10000 Reputation Level)jwdonahue User rank is Second Lieutenant (5000 - 10000 Reputation Level)jwdonahue User rank is Second Lieutenant (5000 - 10000 Reputation Level)jwdonahue User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 6 Days 23 h 14 m 51 sec
Reputation Power: 66
I think you might want to investigate quaternions
__________________
It's not always a matter of what you can do with a language, but whether you should. [JwD]

Reply With Quote
  #7  
Old March 17th, 2007, 03:56 PM
BioSlayer's Avatar
BioSlayer BioSlayer is offline
C# Addict.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Earth
Posts: 283 BioSlayer User rank is Sergeant (500 - 2000 Reputation Level)BioSlayer User rank is Sergeant (500 - 2000 Reputation Level)BioSlayer User rank is Sergeant (500 - 2000 Reputation Level)BioSlayer User rank is Sergeant (500 - 2000 Reputation Level)BioSlayer User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 8 h 52 m 11 sec
Reputation Power: 22
Quote:
Originally Posted by MassKiller
This is important to bear in mind that trigonomic operations basically kill the CPU, looking up a predefined trigonomic value is much more efficient.


I looked around and I couldn't find much on this subject. Would you be willing to post a link or 2 about this?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesGame Development > Converting onto XYZ from vector, need help.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway