COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### easiest way to store orientation and do rotations of a ball?

• Email
• Follow

```Hey guys,

I'm currently making a program which imitates physics of a rotating
ball. Currently I'm trying to figure out the best way to store the
orientation of a ball, and then apply further transformations to it.
Currently the way that I'm thinking of storing x,y,z positions of the
initial "top" of the ball, then somehow using opengl to rotate to that
position and draw it (although I haven't figured out how to do this).
These positions x,y,z, positions are modified by the ball rolling
(rotated first by the angular momentum of the x axis, then by the y).
Does anyone know how to implement this, or do they have a better way
of implementing storing orientation? Also any help with rolling ball
physics would be a big help.

- Steve
```
 0

See related articles to this posting

```"Steve" <stevovore@yahoo.com> wrote in message
> Hey guys,
>
> I'm currently making a program which imitates physics of a rotating
> ball. Currently I'm trying to figure out the best way to store the
> orientation of a ball, and then apply further transformations to it.
> Currently the way that I'm thinking of storing x,y,z positions of the
> initial "top" of the ball, then somehow using opengl to rotate to that
> position and draw it (although I haven't figured out how to do this).
> These positions x,y,z, positions are modified by the ball rolling
> (rotated first by the angular momentum of the x axis, then by the y).
> Does anyone know how to implement this, or do they have a better way
> of implementing storing orientation? Also any help with rolling ball
> physics would be a big help.

You should try to look for some information on quaternions. That's how
rotations are usually handled.

Alan.

```
 0

```
Alan Garny wrote:
>
> "Steve" <stevovore@yahoo.com> wrote in message
> > Hey guys,
> >
> > I'm currently making a program which imitates physics of a rotating
> > ball. Currently I'm trying to figure out the best way to store the
> > orientation of a ball, and then apply further transformations to it.
> > Currently the way that I'm thinking of storing x,y,z positions of the
> > initial "top" of the ball, then somehow using opengl to rotate to that
> > position and draw it (although I haven't figured out how to do this).
> > These positions x,y,z, positions are modified by the ball rolling
> > (rotated first by the angular momentum of the x axis, then by the y).
> > Does anyone know how to implement this, or do they have a better way
> > of implementing storing orientation? Also any help with rolling ball
> > physics would be a big help.
>
> You should try to look for some information on quaternions. That's how
> rotations are usually handled.

.... or matrices.

Using Euler angles as the OP seems to do, almost always leads to
serious problems, especially if rotations can occour in any order.
Any book on computer graphics contains a chapter about matrices
and/or quaternions.

--
Karl Heinz Buchegger
```
 0

```Karl Heinz Buchegger wrote:
> Alan Garny wrote:
>>
>>You should try to look for some information on quaternions. That's how
>>rotations are usually handled.
>
>
> .... or matrices.
>

Yep. Matrices will work just fine.

The only thing quaternions can do which matrices can't is
interpolation of two orientations. After that it's a matter
of personal taste.

--
<\___/>          For email, remove my socks.
/ O O \
\_____/  FTB.    Why isn't there mouse-flavored cat food?

```
 0

3 Replies
437 Views

Similar Articles

12/11/2013 9:36:46 PM
[PageSpeed]

Similar Artilces:

Easiest way to do this?
I need to be able to take any dollar amount, such as 25103.34, and multiply it by 0.0000056. Then I need to take the result and truncate everything after the fifth decimal place, so if the result is 0.140578704, then I will have 0.14057. Then I need to round up to the nearest cent (ceiling function), so if I have 0.14057, then the result will be 0.15. What would be the easiest way to achieve this? On Sep 19, 1:23 pm, "void.no.spam....@gmail.com" <void.no.spam....@gmail.com> wrote: > I need to be able to take any dollar amount, such as 25103.34, and > multiply it by 0....

Best way to store config or preferences in a multi-platform way.
Hi, python beginner starting a new project here. This project will store most of its actual data in a shared-database, but I have a small amount of user specific data that I need to be stored like configuration or preferences for example, the list of databases that the program should connect to. On Unix this might be a .file, on windows this could be in the registry, or an ini file or an xml file in ProgramData or AppData or something. Is there a pythony way to store such config data, perhaps there is already a standard python package for such a purpose? My app uses Qt, and Qt has its...

The Fastest and Easiest Way ,,,,,,,,,,
The Fastest and Easiest Way ,,,,,,,,,, The Fastest and the Easiest Way to start RAKING in Massive amount online is Through a Proven Button System. make money on A autopilot while the system does the hard work A system that requires just one single step to get started Making money on the web is made as easy as possible... no downline no referrals ...just finalize your web site and ..... click on the below link http://www.dreamlifestylesystem.net/Alina/main.html ...

the easiest way to make money \$
MAKE \$6,000 TO \$30,000 IN JUST A FEW WEEKS!!! LEARN HOW TO TURN \$6 INTO \$6000OR EVEN \$60000!! TURN SIX DOLLARS INTO \$6000 EASY AND HONESTLY!!! READING THIS MESSAGE WILL CHANGE YOUR LIFE FOREVER : I found this on a bulletin board and decided to try it. A little : while back, I was browsing through newsgroups, just like you are now, : and came across an article similar to this that said you could make : thousands of dollars within weeks with only an initial investment of : \$6.00! So I thought, "Yeah right, this must be a scam", but : like most of us, I was curious, so I kept reading. ...

a way to store records in a dataset
are there any packages to manage a set of records I got, e.g. from a database? I wrote for this a class CDataset (via incr tcl) and it works good for my needs but maybe there is another better way to handle the records. eherzel eherzel wrote: > are there any packages to manage a set of records I got, e.g. from a > database? > > I wrote for this a class CDataset (via incr tcl) and it works good for > my needs but maybe there is another better way to handle the records. > > > eherzel Is TclKit something that helps you 'manage'? http://equi4.com YekSoon - ...

Smart way to store records (structs)
Would someone offer suggestions as to how I should store structs for symbol table lookup? I haven't written anything to store structs in a symbol table because I dont know what a good way of doing this is. My first thought was linked list but the size of the records aren't going to grow or shrink so that seemed useless. My second thought was to create a pointer block containing a textual version of the record with type and size information. I think that might work but I suspect it will be slow. considering you have to verify the field member and if it points to another record and ...

what is easiest way to extract digits from a decimal?
Suppose I have a floating point number in Maple say x:=.356001528 What is the best way of getting (for example) the sixth digit from this. For example, suppose I wanted a function f where f(n) would return the nth digit of x. I can find fairly complicated ways of doing this such as: f:=n->trunc(10^n*x) mod 10; That's not really complicated but is there a simpler way that I'm overlooking? thx In article <0b163a85-cefd-44da-ba79-0b40a81a5469@a11g2000pri.googlegroups.com>, jude <jw12jw12jw12@yahoo.com> wrote: >Suppose I have a floating point number in...

The easiest way to get free cash!
<HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft DHTML Editing Control"> <TITLE></TITLE> </HEAD> <BODY> <P>Hi all,</P> <P>I became a member of an interesting free website that is totally unique. It actually rewards its members for learning! You can learn lots of important things and earn rewards taking fun quizzes, plus earn cash for other activities! Membership is free, and people of all ages and educational backgrounds everywhere can become members and participate at their own level. It�s called �It P...

best way to store time intervals
Hi, (sorry for my bad english) I'm using access for a complex database, and I need to create a calendar. For exemple : from the 1st of january to the 14th of february, I need to store a yes/no value from the 15th of february to the 25th of february, another yes/no .... The database can handle lots of people, each with one calendar. The calendar run for several years. Is it a good idea to store data for each day of each year ? Or is there another way ? Thanks -- Bubar - Les Studios Du Wapiti Cr�ation de sites internet et de logiciels multim�dias http://www.wapitistudio.com Would...

Fastest/easiest way to communicate computers?
I want to run a program on several computers (one server and several clients). I need bidirectional communication, just to send a few variables per second. Nothing too intensive or intolerant to errors. I know that matlab can do TCP, but still haven?t looked in to it. But if there is a simpler way, hope someone can point me in that direction. Tks anyone? ...

Easiest way to search a list of String in a field?
I want to identify records in my transaction dataset which have desired City Names . My first dataset A1 has 1 column contains few thousand city names. My second dataset A2 is transaction level data, there is 1 string field X that may have the City Name. Some sample contents in field X : PAYPAL *THETOYCAVE 40293577 CREDIT CDN TIRE STORE #000986 SMITH FALL CREDIT WAL-MART SUPERCENTE SCARBOROUGH CREDIT INEX VENTURES INC 80047031 CREDIT I want to find all records in A2 which has a hit of any city name in A1. I want to know how do you usually solve this kind of probl...

The easiest way to get free cash! #2
<HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft DHTML Editing Control"> <TITLE></TITLE> </HEAD> <BODY> <P>Hi all,</P> <P>I became a member of an interesting free website that is totally unique. It actually rewards its members for learning! You can learn lots of important things and earn rewards taking fun quizzes, plus earn cash for other activities! Membership is free, and people of all ages and educational backgrounds everywhere can become members and participate at their own level. It�s called �It P...

Simple way of making Golf Ball with Solidworks!
Please help me! Anyone!? As I know Golf ball has 77 dimples around the surface... Is there anyway making golfball simply? I've read lot's of articles with lots of calculations...but it brings me a headache. Please..help me out.~ Thank you. Search the newsgroup first. Then check 3D Content Central. TOP wrote: > Search the newsgroup first. Then check 3D Content Central. Just curious - why is this so popular it comes up every month? It seems like a largely boring problem that can be solved by any beginner with just a ltitle patience. I suppose it would be mildly interesting if...

The easiest way to get free cash! #2 #2
<HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft DHTML Editing Control"> <TITLE></TITLE> </HEAD> <BODY> <P>Hi all,</P> <P>I became a member of an interesting free website that is totally unique. It actually rewards its members for learning! You can learn lots of important things and earn rewards taking fun quizzes, plus earn cash for other activities! Membership is free, and people of all ages and educational backgrounds everywhere can become members and participate at their own level. It�s called �It P...

easiest way to find child-tags with certain name
Hi what would be the easiest way to find all tag's with a certain name (or class) below (within) a certain tag. Pref jscript DOM thx Arne arne a écrit : > Hi > > what would be the easiest way to find all tag's with a certain name (or > class) below (within) a certain tag. > Pref jscript DOM > > thx > Arne > For links: document.links http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-7068919 For images: document.images http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-90379117 For forms: document.forms http://www.w3.org/TR/DOM-Level-2-HTML/ht...

Easiest way to read one character at a time until the first |
I'd like to grab a line from a file (up to the newline) and then read one character of a lin starting at the far left, until I get to the end of the first data element in a flat text file, (until first pipe symbol reached) counting the number of characters with a counter. Assign the first counter -1 characters to a variable. Then test to see if it matches the string being searched. If it does, then grab the third data element. Everything between the 2nd and 3rd pipe symbol and end the loop. If it doesn't match, then read in the next line from the file. Is this possible? Any ideas a...

Re: Easiest way to search a list of String in a field?
'Easiest' is a multifacted verb. Easy in terms of understanding, processing, replication, and/or something else. One way of doing what you want would be something like the following: /*Build city test file*/ data cities; informat city \$50.; input city &; cards; SMITH FALL SCARBOROUGH Toronto Richmond Hill ; /*Build transaction test file*/ data transactions; informat transaction \$100.; input transaction &; cards; PAYPAL *THETOYCAVE 40293577 CREDIT CDN TIRE STORE #000986 SMITH FALL CREDIT CDN TIRE STORE #000986 Richmond Hill CREDIT WAL-MART SUPERCENTE SCARBO...

Q: easiest way for gawk to convert octal to ascii
Suppose a string contained possibly multiple strings of the form \247 \731 that were octal representations of ascii characters then what is the easiest way for gawk to convert these back to the ascii characters? Thanks RolandRB wrote: > Suppose a string contained possibly multiple strings of the form \247 > \731 that were octal representations of ascii characters then what is > the easiest way for gawk to convert these back to the ascii characters? The highest ASCII character is \177 (octal) so those can't be ASCII characters. man ascii John -- use Perl; program fulfillmen...

Multiple lines of html store in variable non messy way
Hey guys, cant find on the group what i am trying to do, i blam ethat on the search terms. Basically this is the issue: \$Report = "<html><head> <stlye> .greenbold{ font-weight: bold;font-color: green;}.redbold{font-weight: bold;font-color: red;}"; \$Report .= "</style></head>"; How can i change it so that i can do something like: \$Report <<EndOfHTML; <html> <head> <stlye> ..greenbold{ font-weight: bold; font-color: green; } ..redbold{ font-weight: bold; font-color: red; } </style> </head> EndOfHTML you s...

easiest way to plot x,y graphically during run-time?
Hi all, I am trying to visualize a number of small objects moving over a 2D surface during run-time. I was wondering what would the easiest way to accomplish this using Python? Ideally I am looking for a shallow learning curve and efficient implementation :-) These objects may be graphically represented as dots, or preferably as small arrow heads/pointy triangles moving about as their x,y coordinates change during run-time. Thanks, Esmail Esmail wrote: > Hi all, > > I am trying to visualize a number of small objects moving over > a 2D surface during run-time. I was wondering...