Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Di Mai 14, 2024 03:44

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 5 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: Matrix - Getting angles
BeitragVerfasst: Di Mär 29, 2005 23:42 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Im wondering if anyone knows of any source on getting the angles from a matrix. I know there is one in GeometryEx.pas but its never worked right for me.

I need it so i can restrict a Rotating door, so it doesn't rotate into the "world"

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Mär 30, 2005 00:42 
Offline
Guitar Hero
Benutzeravatar

Registriert: Do Sep 25, 2003 15:56
Beiträge: 7804
Wohnort: Sachsen - ERZ / C
Programmiersprache: Java (, Pascal)
I am not sure, but I think any answer to this question has precisionproblems. You need the sin^-1 and cos^-1 of the values in the upper left part of the matrix.
You surely know how the worldmatrix is build (what komponent means what). So you can try to solve it your self, but I thin you get in trouple because floatingpoint operations are not that precise (they sure will fluctuate).

_________________
Blog: kevin-fleischer.de und fbaingermany.com


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Mär 30, 2005 01:18 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
I was good at maths at school. But in the wide world my maths is crap. I know how to apply a matrix to a poitnt to work out the new point, but thats pritty much it. I don't know the maths behind adding an angle to a matrix, let alone "undoing" it.

How precise it is doesn't matter as long as the error margine is 1 degree or less eather side. (since its a restriction, 1 degree over the actual restriction won't matter)

Edit: Its Geometry.pas and it seems to go from -90 to 90, which isn't good since u realry need 0 - 360/-180 - 180

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Mär 30, 2005 13:16 
Offline
Guitar Hero
Benutzeravatar

Registriert: Do Sep 25, 2003 15:56
Beiträge: 7804
Wohnort: Sachsen - ERZ / C
Programmiersprache: Java (, Pascal)
When you get an OpenGLmatrix its components represent this:

the upper left 3x3 matrix stores the rotation and scaling. The first 3 values in the 4th column represent the translations.
The first 3 values in the 4th line represent the perspektive. And the last value (bottom right) is a scalingfactor over all.

The problem is, that your rotation is mixed with the scaling.

Look in this script. Sadly for you its in german. But you can find how to build a rotationmatrix on page 9. What part of a matrix means what, you can find on page 19. (use dict.tu-chemnitz.de if you whant to translate some words ;) )

_________________
Blog: kevin-fleischer.de und fbaingermany.com


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Mär 30, 2005 15:36 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
hmm, think iv thought of a simpler answer. Work out how much the center of the door(worked out by applying the matrix to the max and min and working out the cneter) is around the origin of the door. (which is the point where the door rotates at)

Lovley Q2 To Delphi has a procedure to do this. (the one where it works out what angle the camera should face so u see the enemy that killed u)

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 5 Beiträge ] 
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 5 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.037s | 17 Queries | GZIP : On ]