Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

bugs in the Direct3D coordinate system ??

Stefan K.Stefan K. Member Posts: 2
I'm trying to write a program that shows simply a single picture as a, double picture by using DX7 and a driver for shutter glasses (ELSA Revelator 3D). To make it possible to change the horizontal shift between the two pictures I changed the z-coordinate of the texture that contains the picture. When changing the z-coordinate (between 0 and 1) it would be logical if the shift between the shown two pictures would increase linear. But when first increasing the z-coordinate in
runtime and then decreasing the shift between the shown pictures is zero while the z-coordinate is not zero. While decreasing the z-coordinate of the texture the shift between the shown pictures becomes shorter in bigger steps than while increasing the z-coordinate.
Could it be possible that a matrix is changing ?
How can I manage it that changing the z-coordinate brings a
standardized change of the shift between the double pictures ?

Thanks a lot for any help !

Stefan Kallenberger

------------------------

Do Until MustExit

On Local Error Resume Next

Render

ChangeZ --------------------------
l
DoEvents l
l
Loop l
l
[...] l
l
Sub ChangeZ() <--------



Dim desc As DDSURFACEDESC2
Anzeige.IMCanvas1.backSurface.GetSurfaceDesc desc



' Initializes vertices used to render the background


ll
ll
ll
/
V
With Anzeige.IMCanvas1
DX.CreateD3DTLVertex 0, desc.lHeight, ZCoordinate, 0.5,
&HFFFFFFFF, 0, 0, 1, m_Background(0)
DX.CreateD3DTLVertex 0, 0, ZCoordinate, 0.5, &HFFFFFFFF,
0, 0, 0, m_Background(1)
DX.CreateD3DTLVertex desc.lWidth, desc.lHeight,
ZCoordinate, 0.5, &HFFFFFFFF, 0, 1, 1, m_Background(2)
DX.CreateD3DTLVertex desc.lWidth, 0, ZCoordinate, 0.5,
&HFFFFFFFF, 0, 1, 0, m_Background(3)

End With



Set Texture1 = Nothing


Set Texture1 = Anzeige.IMCanvas1.
CreateTextureSurface(TexFile,0, 0, 0)



End If

End Sub

Comments

  • GrumpusGrumpus Member Posts: 5
    You're running into a problem which has a similar solution to the one that I was having (see: DirectX8 and Multiple Meshes thread). What's happening is that you have everything in a single frame so that when you move one thing, the other thing will move along with it - or, as near as I can tell, because you didn't actually list your translation code.

    You've got to put each separate entity into a "Frame" then translate the frame, not the mesh itself. I'd be a bit more clear on this, but it's something I just got a basic grasp on last night at about 9:00pm (Eastern Time) at which time I went and tried to implement it in my program (which took me up to about midnight) and then I woke up this morning with a brain ache.

    And so, my only help is to go to the docs and I'm pretty sure the solution to your problem lies in the "frames".

    Good Luck, and lemme know if I'm right and if it helps!

    Bo

    P.S. I'm using directx8 which is completely and utterly different from DX7, although I did play around with 7 a while back for a bit. I'm assuming that you're working in IM (which is no longer separated from other modes in dx8). If you're not working in IM, this frame deal might be all wrong.


Sign In or Register to comment.