Can anyone please explain in human terms what is happening with D3DTS_WORLD ??

I read somewhere that the first 255 values are taken, and that "256=WorldTransform #1" and that there was eight possible.

Is this the mystical embedded matrix stack?
If so, what values do I use for other than current worldmatrix?
And if this is a matrix stack, am I to assume that World1 is the LAST matrix to be applied before rending?

Scronty, have you played with it? I notice you simply use the value 256 but then I haven't seen any source for the hierarchical examples you were working on...

Can anyone shed light on the enigma that is D3DTS_WORLD ?
Posted on 2003-10-08 02:22:21 by Homer
All I know is that you can set multiple world transform matrices using this macro. Multiple transform matrices are used in vertex blending. Check the 'Vertex Blend' sample of the dx8.1 SDK.
Hope Scronty can explain it better, but I haven't seen him for quite a long time here....
Posted on 2003-10-08 07:02:17 by Vaxon
Afternoon, EvilHomer2k.

IIRC, D3DTS_WORLD and the others (for view and projection) are macros, and I have never spent the time required to figure out how to create macros in Masm:tongue: .

Initially, I was mucking about with info about the stuff, however in the end I decided to just chuck in 256 for D3DTS_WORLD and be done with it ( I'd rather have *something* working than completely recoding the DX source files to their Masm equivalent).

I haven't been around much as my missus is about to pop a sprog.

Cheers,
Scronty
Posted on 2003-10-09 22:56:20 by Scronty
Really? Congratulations, Dad !! This your first progeny?

I guess I'd be satisfied if you could just confirm my comprehension of this stuff.
I'll briefly describe what I'm doing, and you tell me if you can see anything obviously wrong.

To begin with, I have reworked and thoroughly tested my LinkedList code.
I created a set of 3D objects using D3DXCreateText where each 3D text object is a single character (for entering username). The objects contain individual rotation and position fields.
I then wrote a little function called Object_DrawInPosition.
This function GETS the WorldTransform into a var called matStash, calculates a local worldmatrix for the given object, sets it as current worldtransform, then rends the object mesh, and finally restores matStash as the current WorldXform.

Inside the Object_DrawInPosition function, I also check a mousebutton flag before performing a picktest (against the current object's mesh, in the frame of reference of the current object) which works perfectly. Thanks for that picktest code !!

Now I thought, gee that's looking good, now I'll add a textured Quad to use as a splashscreen and as a LOADING screen. So having done that, I try to Render it, and now none of my other objects will render !!?!

As far as I am aware, WorldTransform should be matIdentity at the moment when the 2DQuad is rendered.

Does this sound weird to you? Or does it sound familiar?

Also, I try forcing the world and projection matrices to Identity, and setting View to Orthographic, and that seems to look absolutely no different.
Posted on 2003-10-10 01:22:13 by Homer
Does your splash screen take up the whole viewport? Could be a Z-buffer problem, where the splash screen is being drawn in front of all the other objects.
Posted on 2003-10-10 02:35:56 by Tatterdemalian
Yes, it does take up the whole viewport, its MEANT to.
But when I change the app state by pressing a key (which disables rending of the textured quad entirely) I should see what I saw before I added this code, ie, the other stuff I am rending. Right?
Posted on 2003-10-10 02:39:58 by Homer
All I can suggest without actually going over the code myself is to check the transform matrices as they're being set with d3dspy. If they aren't being set right, it should help identify the problem; if they are, then it's something else. I suspect, if you've tried using ortho already and still had the problem, that it is something other than the matrices, though.

Anyhow, the original question... from what I've seen, yes, all the transformation matrices are kept internally by D3D. It's not a stack, though, but an array, and each member is used completely differently from the next, unrelated to their actual position in the array. Three of the matrices (D3DTS_WORLD, D3DTS_VIEW, and D3DTS_PROJECTION, corresponding to matrices 256, 2, and 3) are used by the T&L pipeline, in that order, for transforming vertices; the D3DTS_PROJECTION matrix is additionally used in a variety of depth buffer calculations, which is why Microsoft recommends that it be kept W-friendly (that is, matrix._34 = 1.0) at all times. (Note that its default value, the identity matrix, is NOT W-friendly.) Eight other matrices (D3DTS_TEXTURE0 through D3DTS_TEXTURE7, corresponding to matrices 16 through 23) are used to transform texture stage states, and the matrices D3DTS_WORLDMATRIX(1) through D3DTS_WORLDMATRIX(255) (corresponds to matrices 257 - 511) are used only for vertex blending; despite their "WORLDMATRIX" names and the fact that D3DTS_WORLDMATRIX(0) is the same as D3DTS_WORLD, they should NOT be used to concatenate several world transformations, unless you're using vertex blending. This also goes for D3DTS_WORLD1 through D3DTS_WORLD3, which correspond to D3DTS_WORLDMATRIX(1) through D3DTS_WORLDMATRIX(3).
Posted on 2003-10-10 21:50:46 by Tatterdemalian
I'm going to have someone tattoo that to the inside of my eyelids - thanks !!
Posted on 2003-10-11 04:41:53 by Homer