I'm trying to get a 2D Projection, just to render 2 triangles making up one rectangle. Now, I'm completely lost. I've tried almost everything. ported my DirectX VB6 code (from my game, Quadrant Wars) to ASM, result: A device that clears the screen, but no rectangle.

I've also tried to exactly port the code from the Gamedev article: http://www.gamedev.net/reference/articles/article1434.asp, but again no luck.

Then I remembered seeing an example from Scronty with the Vertex Shader, where he had 2 rectangles rotating around. I copied the 3-4 lines that setup the vertexbuffer triangles, made sure the FvF and FvF struct where matching (again), and tried to ran it... again no luck.

I've tried to do a search on this forum for 'D3DXMatrixOrthoLH', but no result, neither on google with 'D3DXMatrixOrthoLH ASM', so I guess nobody here ever tried/accomplished it?

I've attached my code (based on the 'vertices' sample), anyone mind having a quick look onto it?

Thanks,
Almar
Posted on 2002-01-27 05:51:06 by ajoling
Afternoon, ajoling.

I've modified this DX8.1 file to display a piccy.

You'll have to delete the line:
include     \masm32\include\d3dx8math.inl

... because I've been changing the include files again ;) .

As long as libci.lib is in the same directory, you can reassemble the proggy using QEditor (Build All).

The way I've set up the view and projection matrices, is so you can zoom in/out by modifying *eye_vector.z*.

Any questions; just ask away.

Cheers,
Scronty
Posted on 2002-01-27 07:19:05 by Scronty
Hi,

Thanks! I compiled it successfully, but both times I still get an empty (red) window. I've commented/uncommented the include, but it doesn't seem to matter. If it worked on your pc, I guess something must be wrong with the include files. Maybe a combination of Dx8/.1 libs...

Also, what does the "libci.lib" file exactly do? It seems to increase the filesize with a factor of 44 (comparing to the original vertices sample)

Thanks in advance,
Almar

PS: Running Win2k/Voodoo3. I will do a quick boot to Win98 to check if it's an empty window there, as well..
Posted on 2002-01-27 08:07:21 by ajoling
Afternoon, ajoling.

heh. friggin' DX8.1 rubbish:grin:

Try this one. It uses the debug dll. (Which is why this proggy is only 6kb)

Just remember to delete the:
"include \masm32\include\d3dx8math.inl"
line.

Cheers,
Scronty

just noticed that last line in your previous post. voodoo doesn't have DX8.1 drivers
Posted on 2002-02-08 01:00:00 by Scronty
There are Dx8.0 drivers for Voodoo3, and they seem to work perfectly. Although I might buy another card someday (see: http://rookscape.com/vbgaming/forums/view.php?forName=vbgaming&viewID=15674 lol:o)

Back to the topic, I still do not see anything, but! I have been browsing this board for half a day and downloaded any sample code I could find. There was one called "Triangle-strip" (I believe also by you). Instead of using xx vertices, I just set it to 2 or 3... and there I had a wonderfull rectangle! :alright:

Regards,
Almar
Posted on 2002-02-10 07:54:32 by ajoling
Afternoon, ajoling.

I had another look at your proggy.

hrrmmm. It seems that D3DXMatrixOrthoLH takes FLOATs as the parameters.

So! Instead of...


.
.
.
; Matrix

invoke D3DXMatrixOrthoLH, ADDR matProj, 2, 2, 0, 1
mcall [g_pd3dDevice],IDirect3DDevice8_SetTransform, D3DTS_PROJECTION, ADDR matProj
.
.
.

use...


.
.
.
; Matrix

.DATA
fpWidth FLOAT 2.0f
fpHeight FLOAT 2.0f
fpZMin FLOAT 0.0f
fpZMax FLOAT 1.0f
.CODE
invoke D3DXMatrixOrthoLH, ADDR matProj, fpWidth, fpHeight, fpZMin, fpZMax
mcall [g_pd3dDevice],IDirect3DDevice8_SetTransform, D3DTS_PROJECTION, ADDR matProj
.
.
.


... and it works fine:alright:

That's all you have to change:grin: .

Cheers,
Scronty
Posted on 2002-02-10 16:14:08 by Scronty