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.

Dark GDK / Mesh from a memblock or object?

Author
Message
WLGfx
12
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 12th May 2012 10:52
There was a snippet around somewhere but the forum search ain't showing anything up anymore.

IanM has provided DBP with a function to create a blank object with your own vertex and index count but I'm trying to do the same in GDK. Not so long ago I lost a lot of my old code so I'm stuck.

Ideally, I need to create a blank object or mesh for editing the vertices and indices so that I can add it as a limb to another object.

I believe that when creating a memblock mesh you cannot edit the indices of it unless you faff about a lot converting this that and the other.

Any help?

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Matty H
11
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 12th May 2012 18:38
Here is a function that creates a new object, the 'scene' object holds the data that I am creating an object from so you will need to remove this and provide your data instead.



WLGfx
12
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 13th May 2012 16:41
@Matty H - Perfect. Thankyou. It was those missing functions that I couldn't find. I even looked through the DLL with dependency walker to find the functions.

Just another question.

When converting a mesh to an objects limb, do the indices get removed?

After reading some of the old forum posts it seems that they do, but I'm not sure.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Brendy boy
14
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 13th May 2012 17:12
Quote: "When converting a mesh to an objects limb, do the indices get removed?"

no, they only get removed when you convert an object to memblock

WLGfx
12
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 14th May 2012 09:52
Thanks Brendy Boy, it was a little confusing reading through all the old forum posts.

I'm finally on my way to providing a procedural 3d level generator plugin for DBP.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
WLGfx
12
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 18th May 2012 17:49 Edited at: 18th May 2012 17:50
Now I'm almost done but got a smidgen problem.

My first Limb is not showing up in the final object. It runs through the code as if it is setting the limb up, it does that with all of them.

The main function that builds the entire object:


And the function that I'm having the problem with:


It's this bit
that I'm unsure about. I just assumed that when the object is created then the first limb was already set.

And yet my final object has a missing limb...



Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!

Attachments

Login to view attachments
Matty H
11
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 19th May 2012 00:25
If you change this:

To this:

Is the first piece of wall missing instead?

Also, could you just ignore limb zero and always create a new frame and see if that works?

Finally, what happens with this hidden limb when you step through the code, are all the vertices the correct values etc?

WLGfx
12
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 19th May 2012 04:10 Edited at: 19th May 2012 04:17
Hey Matty H, it turned out to be a silly error, I added a bool and this
to all three routines after moving the order of the functions. Now that I've added that simple check then I can put the functions into any order.

Because of the original order, floor, walls and then roof. I took the limb 0 check out of the wall function but not the roof function (I forgot). So when the roof function was running it was that, that wasn't adding the extra limb. Well, between the roof function and the floor function.

My guess is that after a few hours of sleep I manage to see my code with a fresh brain cell.

Thanks Matty for your patience. I can finally finish this off now.

EDIT: I've only got to fix my sorting code now to fix the wall UVs...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!

Login to post a reply

Server time is: 2019-11-17 19:56:19
Your offset time is: 2019-11-17 19:56:19