To convert into world position, you have to multiply by the world matrix. TV passes the World Matrix automatically. So something like this ( untested ) should work :
float4x4 wMatrix:World;
float3 boundingCenter;
float3 viewPos : VIEWPOSITION;
float3 worldPos = mul(viewPos,wMatrix);
float3 myVector = normalize(boundingCenter - worldPos);
No, I've already tried that. It doesn't work.
In fact, I've tried multiplying
viewPos with
all of TV3D's matrix semantics.
None of them work.
I think there might be more than one multiplication involved.
you're not using vectors, you're using floating point numbers.
That doesn't matter. An array of 3 floats is the same as a 3-axis vector. They're completely interchangeable, mathematically speaking.
To get a vector pointing to your camera, you have to do some operation like this:
TV_3DVECTOR posActor = new TV_3DVECTOR();
TV_3DVECTOR posCamera = new TV_3DVECTOR();
now get the information of the actor's position, put that in posActor.x, posActor.y, posActor.z
same for the camera, but put the x, y, z coordinates in posCamera
then:
TV_3DVECTOR myVector = normalize(posCamera-posActor);
that'll be the solution to your problem i guess
Um, I'm doing this in the
shader, not in my TV3D C# code.