#### Archived

This topic is now archived and is closed to further replies.

# Player follow - Matrix question

This topic is 5274 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi! I have 2 world matrix in object space: Object matrix and Player matrix. All matrixes containing position (._41 - ._43) and transform data. I like to transform Object to turn toward Player, but i don''t know how i do it. I used fTurn and fUp FLOAT values to transform like: D3DXQuaternionRotationYawPitchRoll(&qR, fTurn,fUp,0); D3DXMatrixRotationQuaternion(&matR,&qR); D3DXMatrixTranslation(&matT,vVelocity.x,vVelocity.y,vVelocity.z); D3DXMatrixMultiply(&matPosition, &matR, &matPosition); D3DXMatrixMultiply(&matPosition, &matT, &matPosition); Anybody know how i compute fTurn and fUp values? Thx.

Anybody?

##### Share on other sites
Give it some time.

Graham Rhodes
Principal Scientist
Applied Research Associates, Inc.

##### Share on other sites
Last night i thinking about, and i''m going this way:

v1 = (matObject._41,matObject._42,matObject._43);
v2 = (matPlayer._41,matPlayer._42,matPlayer._43);
vDif = v2 - v1;
normalize vDif, and i saw parallel with matObject vDir
vector, which i gave from matObject._31,.32,.33

vDif.x -- matObject._31
vDif.y -- matObject._32
vDif.z -- matObject._33

if vDif values approaching the vDir values the Object is turning
toward the Player. But i''m doing it manual, how can i compute?

Nobody?

1. 1
Rutin
41
2. 2
3. 3
4. 4
5. 5

• 18
• 20
• 14
• 14
• 9
• ### Forum Statistics

• Total Topics
633368
• Total Posts
3011532
• ### Who's Online (See full list)

There are no registered users currently online

×