#### Archived

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

# D3DXMeshIntersect() Direction

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

## Recommended Posts

Hi, The Line that D3DXMeshIntersect() tests is finite or infinite ? I mean:
D3DXVECTOR3   Pos = D3DXVECTOR3( 0.0f, 0.0f, 0.0f );
D3DXVECTOR3   Dir = D3DXVECTOR3( 0.0f, 1.0f, 0.0f );
D3DXMeshIntersect(...);

Is the same as:
D3DXVECTOR3   Pos = D3DXVECTOR3( 0.0f, 0.0f, 0.0f );
D3DXVECTOR3   Dir = D3DXVECTOR3( 0.0f, 2.0f, 0.0f );
D3DXMeshIntersect(...);

KaMiKaZe

KaMiKaZe

##### Share on other sites
I don''t really understand the question, it looks exactly the same except for the 2.0 in place of the 1.0???

pan narrans | My Website | Study + Hard Work + Loud Profanity = Good Code

##### Share on other sites
Yes, that''s exacly my question, will the 1st example give exacly the same
results as the 2nd one ?

KaMiKaZe

##### Share on other sites
The two have the same effect. Since its a "ray", it doesn''t really have an end, just a position and direction. The function however returns the distance to the hit, so I believe if you use that you could effectively check for a line intersection, if that''s what you want.

My question is this: I am also getting an intersection on a triangle, but I need to calculate the texture coordinate for the hit on it. I can figure out where it lies on the plane, but how do I interpolate the three texture coordinates for the hit coordinate?

Thanks.

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• ### Forum Statistics

• Total Topics
633300
• Total Posts
3011266
• ### Who's Online (See full list)

There are no registered users currently online

×