|
-
Apr 29th, 2001, 05:45 PM
#1
Thread Starter
Addicted Member
How do you render in wireframe?
How can you tell D3D you want to render in wireframe? Im using meshes, so linelist won't work. BTW this is DX8.
BTW, Thanks for all your help
Member of the anti-gay cross-dressing trans-species wolves alliance.
-
Apr 29th, 2001, 06:11 PM
#2
Good Ol' Platypus
You should PM or email Zaei. Like he says he is great with D3D8.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Apr 30th, 2001, 08:00 AM
#3
D3DDevice.SetRenderState D3DRS_FILLMODE, D3DFILL_WIREFRAME.
to go back to regular:
D3DDevice.SetRenderState D3DRS_FILLMODE, D3DFILL_SOLID.
Z.
-
Apr 30th, 2001, 09:14 PM
#4
Thread Starter
Addicted Member
BTW, Thanks for all your help
Member of the anti-gay cross-dressing trans-species wolves alliance.
-
May 1st, 2001, 11:57 AM
#5
I havent downloaded the Zip, but for the things that dont want to draw, try "D3DDevice.SetRenderState D3DRS_CULLMODE, D3DCULL_NONE". This stops D3D from culling triangles. For the floar thing, just create a big square, with a custom vertex using "D3DFVF_XYZ or D3DFVF_DIFFUSE or D3DFVF_TEX1", where your vertex type is:
Code:
Type TEXTVERT
X as single
Y as single
Z as single
color as long
tu as single
tv as single
End Type
"tu" and "tv" are the texture "x" and "y" coordinates. they range from 0.0, to 1.0. So, say we have a square....
Code:
(0.0),(0.0)+-----------+(1.0),(0.0)
|\ |
| \ |
| \ |
| \ |
| \ |
(0.0),(1.0)+-----------+(1.0),(1.0)
The coordinates are your texture coordinates. In this example, im showing the entire texture. if all of the "1.0"s at the bottom were "0.5"s, id be showing half of the texture.
If you have any questions, let me know, and ill see what i can do to help.
Z.
-
May 1st, 2001, 09:09 PM
#6
Hyperactive Member
Thanx
Thanx for the help,
I'll try to explain a little better. I've already had all the stuff done which you explained in the previous post, I even had that exact vertex type, the main problem, is that I actually assign the texture to the floor, but it does nothing. I don't get any errors, but also, the floor remains at the four colours that I initially apointed to it. I think that there is something else that I have to set to make it work, for example, I left the tv and tu variables at 0, cause I'm not too sure what they do, and also, the floor is 50 x 50, and my texture is 128 x 128. Plz help me as soon as possible.
Visual Basic 6.0 Enterprise
Visual C++ 6.0 Professional
Wak 
-
May 1st, 2001, 09:40 PM
#7
Good Ol' Platypus
Not too sure as I am not the best with 3D, but I think you need to set the tU and tV settings (UxV, texture width x texture height) to 128x128. This (I believe) sets what drawing width you get from the texture.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
May 1st, 2001, 11:36 PM
#8
Hyperactive Member
Thanx
I'll try it when I get home
Visual Basic 6.0 Enterprise
Visual C++ 6.0 Professional
Wak 
-
May 2nd, 2001, 01:51 PM
#9
Ok. I fixed your project up. The first thing in noticed was that you were using Triangle lists to render your triangles, but you were passing 6 as the number of primitives. You have to set this to 2, because you only want to draw 2 triangles. I guess you were thinking of vertices (ive done that =).
As to the floor thing, there were two things going on. The first, as Sastraxi said, was that you hadnt set up your tu and tv values. The second was that you werent calling D3DDevice.SetTexture before rendering. Here is the code you should replace:
Code:
'//Draw the Landscape
D3DDevice.SetTexture 0, floorTexture
D3DDevice.SetStreamSource 0, VScapeBuffer, Len(Landscape(0))
D3DDevice.DrawPrimitive D3DPT_TRIANGLELIST, 0, 2
D3DDevice.SetTexture 0, Nothing
'//Draw the Roof
D3DDevice.SetStreamSource 0, VRoofBuffer, Len(Landscape(0))
D3DDevice.DrawPrimitive D3DPT_TRIANGLELIST, 0, 2
'Side1
D3DDevice.SetStreamSource 0, vSide1Buffer, Len(Sidescape1(0))
D3DDevice.DrawPrimitive D3DPT_TRIANGLELIST, 0, 2
'Draw the player. It moves!!
D3DDevice.SetTransform D3DTS_WORLD, matSquare 'Make character move
D3DDevice.SetStreamSource 0, VTriBuffer, Len(triList(0))
D3DDevice.DrawPrimitive D3DPT_TRIANGLELIST, 0, 1
TextRect.Top = 0
TextRect.bottom = 20
TextRect.Right = 150
D3DX.DrawText MainFont, &HFFFFCC00, "Press Esc to Exit..", TextRect, DT_TOP Or DT_LEFT
TextRect.Top = 20
TextRect.bottom = 40
TextRect.Right = 250
D3DX.DrawText MainFont, &HFFFFCC00, "Made by Matt Warner...", TextRect, DT_TOP Or DT_LEFT
TextRect.Top = 40
TextRect.bottom = 60
TextRect.Right = 150
D3DX.DrawText MainFont, &HFFFFCC00, "3D-World!", TextRect, DT_TOP Or DT_LEFT
I moved the text drawing to the bottom because it won't show if you draw it first. This is because when you draw onto the back buffer, if you draw some text, then some geometry on top, it is just like BitBlt, or something similar. The text gets covered up. Draw it last, always.
Here is the part i changed in your geometry initialization:
Code:
'Floor
Landscape(0) = CreateLitVertex(-0, DFC, 50, cGreen, 0, 0, 1) 'far right point
Landscape(1) = CreateLitVertex(-0, DFC, -0, cGreen, 0, 0, 0) 'Closes point right 1/2
Landscape(2) = CreateLitVertex(50, DFC, 50, cGreen, 0, 1, 1) 'Farback point right 1/2
Landscape(3) = CreateLitVertex(-0, DFC, -0, cGreen, 0, 0, 0) 'Closest point left 1/2
Landscape(4) = CreateLitVertex(50, DFC, -0, cGreen, 0, 1, 0) 'Far left point
Landscape(5) = CreateLitVertex(50, DFC, 50, cGreen, 0, 1, 1) 'Farback point left 1/2
I just set up the tu and tv values. Note how they range from 0 to 1. Also a tip that i recommend, is that yous hould never use fullscreen until you know that your rendering isnt going to crash, and even better, until you know you wont have to do any breaking in your code at all. When using windowed mode, DO NOT set the back buffer width or height. I suggest a function that takes in a boolean to tell it if you want windowed or not, and the backbuffer heights and widths. When you set your presentparams if you want windowed, dont set the back buffer height or width.
Hope that helps you out.
Z.
-
May 2nd, 2001, 01:54 PM
#10
I just re-read Sastraxi's post, and i have to make a correction. For textures, tu and tv can only range from 0.0 to 1.0. They are percentages. Textures can only be of sizes 2^X.
Z.
-
May 3rd, 2001, 05:12 AM
#11
Hyperactive Member
Zaei, u are an absolute legend
I owe u so so much, than u, thank u, thank u. If you have a website with banners on it anywhere, tell me it and I'll visit it 100000000 times just to get you the 1 cent per click or whatever. Thanks. But of course, now I can't be happy. That textture that waz there, how can I tile that as the floor instead? Really sorry, but thanx a million....
Visual Basic 6.0 Enterprise
Visual C++ 6.0 Professional
Wak 
-
May 3rd, 2001, 05:36 AM
#12
Hyperactive Member
-
May 3rd, 2001, 05:23 PM
#13
-
May 3rd, 2001, 05:32 PM
#14
Good Ol' Platypus
They must ALWAYS be 1 according to Zaei
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
May 3rd, 2001, 06:18 PM
#15
They dont HAVE to be 1, but that just shows the entire texture.
Z.
-
May 4th, 2001, 12:54 AM
#16
Hyperactive Member
Thanx
I got it now, thanx for the help.
Visual Basic 6.0 Enterprise
Visual C++ 6.0 Professional
Wak 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|