Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Problem generating mesh from memblock

Author
Message
Image All
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 4th Oct 2010 22:45 Edited at: 4th Oct 2010 22:57
i can't seem to get this right. i've looked over the numbers and i think they should work. when i run this program i'm supposed to see a large flat plane with many subdivides but i see nothing. halp



edit: o wait i just realized this only makes one vertex per grid square. i'mma fix it and see if i see anything then.

re-edit: nope, it didn't fix it. this is the new code, that should make 2 polys per loop (6 verts):



Remember those old guys? They made epic renders, I think one of them was called DaVinci, and all they used was MS Paint. Sometimes it's just skill....
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 5th Oct 2010 12:55 Edited at: 5th Oct 2010 12:56
Well, the first thing I noticed was: why are you wring DWORDS when the position, normals and uv data are floats? I'm not sure how DBP converts its floats to a DWORD, but I suspect that might give some problems.

Also, I'm not sure if this is intended, but the last 2 lines in 'makeVertex' use (x#, z#) instead of (u#, v#) (making u# and v# superfluous). They should range from 0.0 to 1.0, and you're only dividing by 10 instead of the total size of the mesh. Of course, if you plan to tile the texture per tile, this should work too.

Cheers!
Sven B

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 5th Oct 2010 14:45
Try this:





The main problem was this section:



You forgot to move the pos counter along by 36 for each of the 6 vertices.
Image All
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 7th Oct 2010 00:50
oh snap. treating verts like dwords. thanks GG


Remember those old guys? They made epic renders, I think one of them was called DaVinci, and all they used was MS Paint. Sometimes it's just skill....

Login to post a reply

Server time is: 2026-07-22 03:51:27
Your offset time is: 2026-07-22 03:51:27