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 / mesh and memblocks - shifting trouble

Author
Message
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 5th Mar 2011 01:09
Hey guys!


I'm trying to make a function that can pick out one face of an object from a memblock, shift the data for that face to the very end of the memblock, and then shift all of the data above where I "took out" the face down to patch it up again. Here's the code:



For me the function seem logical, but it does some weird things with the mesh... I shouldn't be able to detect any visual changes in the mesh, just that the data for one face is now at the very end of the memblock.

I designed the function so 1 face is made up of 6 vertices. So if I set Pos to a value of 1, this would mean vertices 7-12 should be shifted to the end of the memblock. A value of 0 would mean vertices 1-6, a value of 2 would mean vertices 13-18.

Any help greatly appreciated!

TheComet

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 5th Mar 2011 01:53
Well I solved it, the problem was that I was copying bytes instead of floats in this section:



should be:



complete code:



TheComet

Login to post a reply

Server time is: 2026-07-16 04:36:30
Your offset time is: 2026-07-16 04:36:30