Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Rotten bug in very basic D3D8 code!
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

STufaro
Neophyte

8 Posts

Posted - Jul 25 2006 :  9:04:04 PM  Show Profile  Send STufaro an AOL message  Reply with Quote
Hey guys,

Yesterday I began the excellent tutorials on Direct3D8 at directx4vb.vbgamer.com

I decided to go off the beaten path a little before getting into the next few lessons and decided to make a landscape program.

Actually, two programs. One is the dirty little mapping program that I whipped together in about five minutes. The other is the program that actually renders the map. That's the one with the problem.

It seems that about a dot from random textures is all that renders (almost as if it's teasing me). My "water" (which is a blue square) used to render but then stopped rendering altogether despite my code not changing! Something's up here.

I've included a ZIP archive with my files in it.

Closing notes:

- the "textures" aren't really textures, they're just BMP placeholders for when I get real textures
- the code to load the actual map file in is a mess; the map file format is a mess
- there are two folders in the ZIP I have attached. The one with the problem is Land3D_VB. The other is the heightmap editing utility.

Thanks in advance for looking into it, guys. Your help is much appreciated in advancing the knowledge contained in my puny brain :)

Thanks again,
- Steve.

Download Attachment: lndscp.zip
14.3 KB

Spodi
Warrior

USA
142 Posts

Posted - Jul 26 2006 :  03:47:16 AM  Show Profile  Visit Spodi's Homepage  Send Spodi an AOL message  Click to see Spodi's MSN Messenger address  Send Spodi a Yahoo! Message  Reply with Quote
I cant figure it out either - though I do get just dots, too, so we can know that it isn't your computer but rather your code. ;) Are you sure the camera is set up right? Sorry I cant be of much more help - I never have delt with actual 3d, just 2d on a 3d engine. ;)


vbGORE
Go to Top of Page

STufaro
Neophyte

8 Posts

Posted - Jul 26 2006 :  07:49:44 AM  Show Profile  Send STufaro an AOL message  Reply with Quote
Thanks for your reply!

I developed the program on a 450MHz PIII with a 16MB Diamond Viper V550 (it uses an nVidia TNT chipset I think), 64MB RAM on Windows 98. I think that ought to be quite enough to run it (it only renders 514 trianlges windowed)! I brought the compiled .exe to my Dell (1.6GHz P4, 128MB Radeon 9600) and had the same results.

As for my camera, it should be set up okay. I have it placed (I think) at (25, 25, 25) which is far enough away to see the entire scene; that only extends out to (17, 2, 17). Playing with the cameras got me nowhere, unfortunately. (Originally I thought my camera was inside the mountain I made)

I think the problem with my code is in the DrawPrimitiveUP() part in the Render sub. The "2" in there - should that be something different, perhaps?

Thanks very much for your help and looking into it, Spodi. Hopefully someone else catches what I'm missing.
Go to Top of Page

STufaro
Neophyte

8 Posts

Posted - Jul 26 2006 :  12:36:26 PM  Show Profile  Send STufaro an AOL message  Reply with Quote
I've had some minor breakthroughs but the problem itself isn't solved.

- The water stopped rendering because of culling. Uncomment the line that turns culling off.
- Put the camera at (25, 0, 25)
- In the loop in the Render sub, change "TRIANGLESTRIP" to "POINTLIST"
- Run the program and click start

You'll see what I'm attempting from a slightly better angle.
Go to Top of Page

Almar
Moderator

Netherlands
192 Posts

Posted - Jul 28 2006 :  4:22:26 PM  Show Profile  Visit Almar's Homepage  Send Almar an ICQ Message  Reply with Quote
1) Add

D3DDevice.SetRenderState D3DRS_FILLMODE, D3DFILL_SOLID

Somewhere t obe sure it's rendering solid

2) Your vertex data is messed up. I checked out the contents of:

Land(i, j)

@

D3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, Land(i, j).verts(0), Len(Land(i, j).verts(0))

Using the watch window, and all 4 vertices have 0 0 0 as position, makes not much of a triangle :). Tex coords and everything seem to be OK.
Go to Top of Page

STufaro
Neophyte

8 Posts

Posted - Jul 28 2006 :  5:16:05 PM  Show Profile  Send STufaro an AOL message  Reply with Quote
Much thanks for the reply! Will try it out now and get you the results ASAP.

I wasn't sure if you could have an array of types with arrays in it, or, for that matter, an array of arrays...
Go to Top of Page

STufaro
Neophyte

8 Posts

Posted - Aug 01 2006 :  11:17:38 AM  Show Profile  Send STufaro an AOL message  Reply with Quote
Success!

It turned out to be a logic error in the vertex init code like you said, Almar! Thanks for pointing me in the right direction (and sorry for the late reply)!

Go to Top of Page

Almar
Moderator

Netherlands
192 Posts

Posted - Aug 05 2006 :  05:28:33 AM  Show Profile  Visit Almar's Homepage  Send Almar an ICQ Message  Reply with Quote
I'm glad that you found it! :)
Go to Top of Page

cbx
Swordmaster

Canada
296 Posts

Posted - Aug 08 2006 :  05:31:34 AM  Show Profile  Visit cbx's Homepage  Send cbx an ICQ Message  Click to see cbx's MSN Messenger address  Send cbx a Yahoo! Message  Reply with Quote
quote:
Originally posted by STufaro
It seems that about a dot from random textures is all that renders (almost as if it's teasing me). My "water" (which is a blue square) used to render but then stopped rendering altogether despite my code not changing! Something's up here.



It feels like that happends to me all the time...

Created by: X
http://www.createdbyx.com/
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.11 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.