I noticed that the TI89 uses something called "eyes" to keep track of where the camera is around the figure and at what angle.

Can anybody tell me how to do this or any other strategy that will work? otherwise I will have to keep a list of every preiouvs rotation, which will slow things down more and more as it goes along

It looks like you're new here. If you want to get involved, click one of these buttons!

- 140.8K All Categories
- 103.6K Programming Languages
- 6.4K Assembler Developer
- 401 Assembly Code Share
- 239 Getting started in assembly
- 4.6K x86 Assembly
- 1.9K Basic
- 97 Qbasic
- 39.9K C and C++
- 5.6K Beginner C/C++
- 330 C/C++ on Linux/Unix
- 450 C/C++ Windows API
- 522 C++ Builder
- 253 C++ Game Development
- 3.3K C++ MFC
- 103 C++.NET
- 404 Visual C++
- 2.9K C#
- 7.9K Delphi and Kylix
- 334 Advanced Delphi
- 360 Delphi beginners
- 4 Haskell
- 9.7K Java
- 56 Enterprise JavaBeans
- 1.3K Java Beginners
- 304 Java Server Pages
- 4.1K Pascal
- 1.3K Perl
- 11 Perl 6
- 2K PHP
- 546 Python
- 37 Ruby
- 4.4K VB.NET
- 258 Advanced VB.Net
- 1.6K VBA
- 20.8K Visual Basic
- 767 Access databases and VB
- 831 Advance Visual Basic
- 1.2K Beginner VB
- 2.6K Game programming
- 315 Console programming
- 90 DirectX Game dev
- 1 Minecraft
- 112 Newbie Game Programmers
- 2 Oculus Rift
- 9K Applications
- 1.8K Computer Graphics
- 279 3D Graphics
- 129 DirectX
- 125 OpenGL
- 740 Computer Hardware
- 9 Cooling & Overclocking
- 3.4K Database & SQL
- 1.1K Access
- 91 ADO Programming
- 288 MySQL
- 358 Oracle
- 440 SQL-Server
- 535 Electronics development
- 1.6K Matlab
- 628 Sound & Music
- 25 DirectSound
- 257 XML Development
- 3.3K Classifieds
- 199 Co-operative Projects
- 198 For sale
- 190 FreeLance Software City
- 1.9K Jobs Available
- 603 Jobs Wanted
- 209 Wanted
- 2.9K Microsoft .NET
- 1.8K ASP.NET
- 1.1K .NET General
- 22 .NET WEB-Services
- 129 .NET WinForms
- 14 .NET XML
- 50 ADO.NET
- 142 C# & VB.NET School Support
- 3.4K Miscellaneous
- 4 Join the Team
- 354 Comments on this site
- 69 Computer Emulators
- 2.1K General programming
- 187 New programming languages
- 621 Off topic board
- 200 Mobile & Wireless
- 72 Android
- 126 Palm Pilot
- 338 Multimedia
- 154 Demo programming
- 184 MP3 programming
- 0 Bash scripts
- 27 Cloud Computing
- 1 Witsbits Go Cloud
- 53 FreeBSD
- 1.7K LINUX programming
- 1 Awk scripting
- 332 Linux Support
- 0 Sed scripting
- 370 MS-DOS
- 0 Shell scripting
- 321 Windows CE & Pocket PC
- 4.1K Windows programming
- 177 COM/DCOM
- 61 Networking And Security
- 17 Windows 2003 Server
- 6 Windows Vista
- 176 Windows XP
- 939 Software Development
- 416 Algorithms
- 68 Object Orientation
- 24 RUP & UML
- 91 Project Management
- 95 Quality & Testing
- 268 Security
- 63 Evil Scripting
- 81 Hacking
- 7.7K WEB-Development
- 1.8K Active Server Pages
- 61 AJAX
- 4 Bootstrap Themes
- 55 CGI Development
- 28 ColdFusion
- 224 Flash development
- 1.4K HTML & WEB-Design
- 1.4K Internet Development
- 131 Mobile Internet & Messaging
- 211 Wireless development
- 2.2K JavaScript
- 37 JQuery
- 304 WEB Servers
- 153 Apache
- 79 IIS
- 150 WEB-Services / SOAP

## Comments

:

: I noticed that the TI89 uses something called "eyes" to keep track of where the camera is around the figure and at what angle.

:

: Can anybody tell me how to do this or any other strategy that will work? otherwise I will have to keep a list of every preiouvs rotation, which will slow things down more and more as it goes along

:

Don't know what to tell you on the 89. I use GL and each object structure has three axis vars for storing the rotation values. Dunno' what your extra three axis are, unless you mean time, space, and something. Maybe you could explain what the fourth, fifth, and sixth dimensions are so we can better understand and help you?

-[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]

:

I use the same method in DirectX: I have an object class and a Rotation 3D vector inside it, whose component are the current object angle.

You can easily calculate the rotation matrix having the three angles simply multiplying the rotation matrices on each of the 3 axis.

nICO

[hr]

[italic]How beautiful, if Sorrow had not made sorrow more beautiful than Beauty itself.[/italic]

JOHN KEATS

:

: -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]

:

Well on the TI83+, you have tto save mem / speed; it takes more to store +angle and -angle sin&cos values, so I just use a +angle; to rotate backwards though, you just switch the axis. Thus, I tell it to rotate along XY, XZ, YZ, YX, ZX, or ZY axis.

What do you mean by storing angle values? I think I know, but then you must know which comes first. EX: rotating 5* on XY and then 5* on ZX is NOT the same as doing ZX and then XY rotation, so how does it compensate? Is one referenced from the other like one of those multi-axis spinny things that you get in the middle of and it spins on many axis at once?

:

: nICO

:

: [hr]

: [italic]How beautiful, if Sorrow had not made sorrow more beautiful than Beauty itself.[/italic]

: JOHN KEATS

:

Can you say that in English? how you multiply what matrix on the axis? Just so you know, I am doing this all MANUALLY (I learned how to program in Java and do window components & Graphics; I figured out all the stuff I use for 3D stuff, I just tell Java to draw the 2D version of it all)

: Can you say that in English?

how you multiply what matrix on the axis? Just so you know, I am doing this all MANUALLY (I learned how to program in Java and do window components & Graphics; I figured out all the stuff I use for 3D stuff, I just tell Java to draw the 2D version of it all)

:

It's not difficult...

A 3D world can be defined by 3 axis, x, y and z.

So, the rotation of the object can easily be stored with 3 params, that you can call rotx, roty and rotz and represent the rotation around the above axis.

You can represent every transformation in the 3D space with a matrix that you can use to multiply the coordinates of a 3D point to get its transformed.

That means that:

[code]

- -

| M11 M12 M13 |

[x' y' z'] = [x y z] * | M21 M22 M23 |

| M31 M32 M33 |

- -

[/code]

The rotation matrices are:

[code]

X rotation:

- -

| cos(rotx) -sin(rotx) 0 |

| sin(rotx) cos(rotx) 0 |

| 0 0 1 |

- -

Y rotation:

- -

| 1 0 0 |

| 0 cos(roty) -sin(roty) |

| 0 sin(roty) cos(roty) |

- -

Z rotation:

- -

| cos(rotz) 0 sin(rotz) |

| 0 1 0 |

| -sin(rotz) 0 cos(rotz) |

- -

[/code]

So, if your object is rotated 20 degrees on x 30 on y and 50 on z you just calculate the sin and cos of the 3 angles, substitute them in the matrices, then do Mx * My * Mz (multiply the 3 matrices) and, at last, multiply your point 3D coords by the matrix you obtained.

And that's all...

PS: this is the best way I can express myself in English... if you don't understand I can always explain it to you in Italian!

nICO

[hr]

[italic]How beautiful, if Sorrow had not made sorrow more beautiful than Beauty itself.[/italic]

JOHN KEATS

: A 3D world can be defined by 3 axis, x, y and z.

: So, the rotation of the object can easily be stored with 3 params, that you can call rotx, roty and rotz and represent the rotation around the above axis.

: You can represent every transformation in the 3D space with a matrix that you can use to multiply the coordinates of a 3D point to get its transformed.

:

: That means that:

:

: [code]

: - -

: | M11 M12 M13 |

: [x' y' z'] = [x y z] * | M21 M22 M23 |

: | M31 M32 M33 |

: - -

: [/code]

:

: The rotation matrices are:

:

: [code]

: X rotation:

:

: - -

: | cos(rotx) -sin(rotx) 0 |

: | sin(rotx) cos(rotx) 0 |

: | 0 0 1 |

: - -

:

: Y rotation:

:

: - -

: | 1 0 0 |

: | 0 cos(roty) -sin(roty) |

: | 0 sin(roty) cos(roty) |

: - -

:

: Z rotation:

:

: - -

: | cos(rotz) 0 sin(rotz) |

: | 0 1 0 |

: | -sin(rotz) 0 cos(rotz) |

: - -

:

: [/code]

:

: So, if your object is rotated 20 degrees on x 30 on y and 50 on z you just calculate the sin and cos of the 3 angles, substitute them in the matrices, then do Mx * My * Mz (multiply the 3 matrices) and, at last, multiply your point 3D coords by the matrix you obtained.

:

: And that's all...

:

: PS: this is the best way I can express myself in English... if you don't understand I can always explain it to you in Italian!

:

: nICO

:

: [hr]

: [italic]How beautiful, if Sorrow had not made sorrow more beautiful than Beauty itself.[/italic]

: JOHN KEATS

:

I am still a little confused... is there ONE matrix that you multiply [x,y,z] by? I guess each is found by it's corresponding rotation matrix, but how? you can't multiply [x] by a 3x3 Matrix; do I find the determinant of each to find the new coordinates?

Multiplying a 1*3 vector by a 3*3 matrix yealds to a 1*3 vector

[x' y' z'] that contains the transformed point coords.

nICO

[hr]

[italic]How beautiful, if Sorrow had not made sorrow more beautiful than Beauty itself.[/italic]

JOHN KEATS

how do you keep the 3 angles updated? This better not be about simple rotation, which I can do; This IS about keeping track of 3 constantly changing transformation angles and finding each orientation from a constant postition, right?

I don't see anything in there that explains how to keep track of this stuff, just some compicated steps for ONE rotation. Can you explain, or do you really know what I'm talking about?

(thanks for your help)

lets say that you have 3 numbers to keep track of x,y, and z rotation.

They start out at zero: rotate 30 degrees around the x-axis, and the xnumber is 30, but the y and z numbers are affected; then rotate around the y-axis 45 degrees: ynumber=45, and the other angles are affected... do this many times...

now the figure has never really moved; to get it to the postion where it should be after all that, find where the angles meet or something...but then it may be rotated incorrectly around the axis described by these combined rotations (not sure); wouldn't that work?

How would you rotate on WHICH plane(s) to get it in that orientation? I suppose any might work, as long as you re-figure it for every point...what can you say of any of this; is that what the whole matrices thing does?

I have a class CObj that contains 3 members: Pos, Rot and Scale, that are 3D vector, so that each of this member store 3 values, 1 for each axis.

I also have a CApp class that contains a list of CObj objects, and also other stuff (like cameras, lights, textures and so on).

The CObj class has various methods to set the position, the rotation and the scaling of the objects... so every time I change a value I recalculate the position, rotation and scaling matrices (position and scaling can be handled easily with matrices, like I told you for rotation). Note that I recalculate the matrices only when needed.

I also store the pos*scale*rot matrix, so I don't have to calculate it for every frame; note that the multiplication of matrices is NOT commutative (ie. A*B is different from B*A) so the order matters and it's important to multiply the matrices in the correct order or you'll have wrong results.

You should also calculate a perspective matrix, that corrects the trasformation obtained by the above matrix, taking in account the perspective (this matrix depends by the camera parameters).

So... it's a lot of math stuff and it's not as easy as it seems!

If you want to do something estetically good and in real-time I suggest you to use DirectX or OpenGL (the one which you prefer, they're both good) and to switch to C++.

nICO

[hr]

[italic]How beautiful, if Sorrow had not made sorrow more beautiful than Beauty itself.[/italic]

JOHN KEATS