rotation / translation problem

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
dieter
Posts: 4
Joined: Tue Mar 04, 2008 8:32 am

rotation / translation problem

Post by dieter »

Hi

sorry - its not a very good topic

I am trying to implement a google earth similar movement in my own application. I ve started based on cityfly and it looks most the time really good; but when I have a pitch of about 90 deg. and then a heading of about 90 deg. my translation goes wrong (instead of going to the left it goes to the front ...).

I use (like cityfly) sbdata [3] and sbdata[4] (sbdata[5] = roll = 0) directly for the rotation -
for the translation I use:
SPW_ArbitraryAxisToMatrix (Rd, sbdata + 3, 1.0f);

SPW_Mult44x44 (Spw_World_to_eye, Spw_World_to_eye, Rd);

Spw_World_to_eye[3][0] -= sbdata[0];
Spw_World_to_eye[3][1] -= sbdata[1];
Spw_World_to_eye[3][2] += sbdata[2];

SPW_InvertMatrix (eye_to_world, Spw_World_to_eye);
pos [0] = eye_to_world[3][0];
pos [2] = -eye_to_world[3][1];
pos [1] = eye_to_world[3][2];

I use a different coordinatesystem, therefore I have switched same axis and directions.

Could s.o. give me a hint what iI'm doing wrong or can give me another way how to impelement it in my app.

Thanks

Dieter
alexus
Posts: 39
Joined: Sat Apr 19, 2008 9:42 am
Location: New York, NY
Contact:

Post by alexus »

if u use VB, can you post your code? othervise its hard to tell whats going on ...
Post Reply