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 / Using a Memblock to manipulate the vertexdata of an object consisting of only one polygon

Author
Message
Nabz_32x
17
Years of Service
User Offline
Joined: 25th Oct 2008
Location:
Posted: 13th Oct 2013 14:09
Hello again,

I used Lock vertexdata to manipulate my Level Polygons for smooth loading in my game, however as this has to be done every Frame the map scrolls, I would like to do this using memblocks.

I would go on to convert each object into a memblock ( each object is just a single 3d triangle [or polygon] ) and alter this memblock, then converting it back.
However i think the positions of each vertex are in double Format ( for each x y and z ), anyone knows how exactly the memblock will be constructed in dbpro?
I think there Needs to be normal data, some of the Settings data ( wire, transparent, cull and so on ), texture data in General.

Anyone knows the exact order and number of elements that would be stored in Memory for an unanimated 3d object containing just a single polygon?

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 13th Oct 2013 15:39 Edited at: 13th Oct 2013 15:41
I created a tutorial about this via the image link below; perhaps you will find most of your answers toying around with the sample code:


Nabz_32x
17
Years of Service
User Offline
Joined: 25th Oct 2008
Location:
Posted: 13th Oct 2013 17:46 Edited at: 13th Oct 2013 19:03
thx for this tutorial, it is a good read.
I will update this post if I still get some issues, or if I have succes.

Edit: issues sorted for now.

Edit2: I had success using your method, however it is not noticeably faster than using lock vertexdata for limb.

Edit3: This method is even slower than using Lock vertexdata for limb, I think it is because the object has to be copied over to a mesh and a new object has to be made from the mesh each time the "Terrain" is altered.

Login to post a reply

Server time is: 2026-07-07 03:46:01
Your offset time is: 2026-07-07 03:46:01