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

## Recommended Posts

I found some code which lets you hook the directx device functions

What is happening here?

float* pMyData = (float*)pConstantData;

coords[0] = *(pMyData + 0); //4th element is the X
coords[1] = *(pMyData + 1); //8th element is the Y
coords[2] = *(pMyData + 2); //12th element is the Z
coords[3] = *(pMyData + 3); //4th element is the X
coords[4] = *(pMyData + 4); //8th element is the Y
coords[5] = *(pMyData + 5); //12th element is the Z
coords[6] = *(pMyData + 6); //4th element is the X
coords[7] = *(pMyData + 7); //8th element is the Y
coords[8] = *(pMyData + 8); //12th element is the Z
coords[9] = *(pMyData + 9); //8th element is the Y
coords[10] = *(pMyData + 10); //12th element is the Z
coords[11] = *(pMyData + 11); //4th element is the X
coords[12] = *(pMyData + 12); //8th element is the Y
coords[13] = *(pMyData + 13); //12th element is the Z
coords[14] = *(pMyData + 14); //4th element is the X
coords[15] = *(pMyData + 15); //8th element is the Y


##### Share on other sites

That code is copying 16 floats from an array of floats to another array.

16 floats could be a 4x4 matrix or anything else.

You could write the same thing like this:

coords[0] = pMyData[0];
...
Edited by TiagoCosta

##### Share on other sites

so the matrix passed to the shader could be accessed like this?

etc you could access the translation values from a matrix that is like world*view*projection?

Edited by Anddos

##### Share on other sites
Hi.
It looks like someone is over riding the texture coords.

Why hook other progams.

1. 1
2. 2
Rutin
19
3. 3
JoeJ
16
4. 4
5. 5

• 35
• 23
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631701
• Total Posts
3001811
×