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 Discussion / Memblock mesh as a matrix?

Author
Message
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 24th Jan 2004 14:10
Hi everyone!

Im trying to increase the Frames per Second of my 3d RTS game. I remember that there is some memblock mesh command (i've never worked with memblocks... they're scary ) for changing meshes with memblock data. Is it possible to program something like a matrix with that or is that slower than a matrix. All those height calculations ... hmm... i can do that but i just need some help with those memblocks

Juzt a dude who likez progging - Me loves RTS games
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Jan 2004 14:33
http://darkbasicpro.thegamecreators.com/?m=codebase_view&i=ff622260deaf05fa7890237516f9147f

Although I'm not sure about backwards compatability, this is a Pro snippet.

"Nowadays more and more of our imports are coming from abroad" - George Bush

Formerly David89.
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 24th Jan 2004 18:35
nope, i dont have dbpro and doesnt work on dbc

Juzt a dude who likez progging - Me loves RTS games
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Jan 2004 20:17
Then I think your options may be limited

"Nowadays more and more of our imports are coming from abroad" - George Bush

Formerly David89.
hexGEAR
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 24th Jan 2004 23:07
i think it's possible in dbc enhanced version, not a port though, you'd have to understand and learn from his code and reproduce one yourself...

Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 25th Jan 2004 11:53
I have DB enhanced... I tried to modify a plain with the memblock but it didn't worked properly... if anyone knows how to modify vertices with a memblock, plz tell me

Juzt a dude who likez progging - Me loves RTS games
hexGEAR
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 25th Jan 2004 21:35
check out the db help files, under memblocks there's a pretty good explanation of how they store mesh data from objects.

Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 26th Jan 2004 10:30
The problem with using the memblock commands to modify mesh's, is that you have to create the object, get the mesh, destroy the object, change the mesh, recreate the object...

It's not much more efficient than a matrix I'm afraid.

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 26th Jan 2004 17:07
No jess... its easier

you DONT have to delete the object each loop, but there some command (see help - basic3d - mesh commands) that changes the mesh of an object without deleting it . Also i want 2 use it because my game uses a HUGE texture that is spread entirely over the matrix. And when you zoom in, you see tile edges (Ugly!). If i use a mesh the problem is solved But changing mesh points it TERRIBLY hard!

Juzt a dude who likez progging - Me loves RTS games
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 26th Jan 2004 17:56
Fair enough... I guess your talking about Change Mesh, right...

Well, as I said in your other thread, look in the Code Base for "Vertex Manipulation" and there should be some stuff there concerning memblocks and their mesh format etc.

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 26th Jan 2004 22:03
Nope, nothing

Juzt a dude who likez progging - Me loves RTS games
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 27th Jan 2004 00:07
You could just use an .X model, texture it, and use that as your matrix. You could use a line-object intersection algorithm to get the height at an x and y. I think someone has written something like that for dbc before. But if you wanna stick with the matrix so you can update its form, then a model might be a bad idea.

"eureka" - Archimedes
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 27th Jan 2004 09:09
The vertex manipulation snippet is Here.

It only took about a minute of searching for "Vertex Manipulation", but I guess you must have over-looked it.

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 27th Jan 2004 16:31
Yeah it think i overlooked it... Hmm... seem to look useful I'm going to test it right now!

Juzt a dude who likez progging - Me loves RTS games
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 27th Jan 2004 16:46
I tried it... its DBpro ! The code actually did work... but when i changed 1 vertex point, the entire object just disappeared... I dont know why but it happend... I tried 2 modify meshes myself but no succes -> the mesh appeared well, but when i changed the float number slightly (just +1 every loop to test it...), it started flapping all around!!!???!!! HELP ME!!! IM IN TROUBLE!!!

Juzt a dude who likez progging - Me loves RTS games
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 28th Jan 2004 02:49
its for DBP, it wont work

Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 28th Jan 2004 09:07
Here, this was a vertex manipulation snippet that I made as an example for a friend that was for use in DBP, but it works in DBC ( but, for some reason DBC doesn't like it when I try to manipulate any other vertex other than number 2. Oh well. )




Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 29th Jan 2004 21:07 Edited at: 29th Jan 2004 21:12
Hey that works nice

But one more problem... i can only modify build in primitives... if i load a .x or .3ds file, nothing happens

[EDIT]

Oh wait, i fixed that, but i need to delete and rebuild the object each loop... and another problem... if i want to change the y value of a vertex, it just chooses a direction, sometimes up, sometimes left, etc... very wierd!

Juzt a dude who likez progging - Me loves RTS games
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 30th Jan 2004 05:27
Hmm, well, how are you using the function?

And with loading models, you shouldn't have to destroy it and recreate it using the method that I put in the exemple

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 30th Jan 2004 17:29
Just as you did in the example, but then using my own model... and if i dont destroy and recreate it, nothing happens (dont know why)

Juzt a dude who likez progging - Me loves RTS games
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 30th Jan 2004 17:53
Maybe the root limb is set to something weird in the object.

To be on the safe side - perhaps you should load your model, make the memblock - then create a new object from the mesh instead of changing the mesh. That way you'll have a pure mesh model, you will need to load the texture yourself and do a bit of manual texturing, but it's probably a good way to maintain WYSIWYG.


Van-B


The nature of Monkey was irrepressible!.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 31st Jan 2004 09:41
Thanks for the input Van B

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 31st Jan 2004 21:20
When i use the code, some vertices move along their y axis, but others move along x or z... thats wierd

Juzt a dude who likez progging - Me loves RTS games
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 1st Feb 2004 23:55
_manipulate(obj,mesh,mem,vertex,newx,newy,newz,xrate,yrate,zrate)


The newx, newy, newz commnds are flags ( either 1 or 0 ) that determine weather or not to move the vertex along each of those axies.

Ie, if you set newx to 1, it would only move the vertex along the x axis.
if you set newx to 1 and newy to 1, it would move along both axies ( thus, moving ata 45 degree angle to both ).

etc etc.

If that's not your problem, then I'm not too sure what else to suggest, but if you want you can email me the model, and i can have a look at it for you? Yeah?

[email protected]

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 2nd Feb 2004 19:50
Nope thats not the problem... i send a mail to you 5 mins ago so it i hope you can fix it

Juzt a dude who likez progging - Me loves RTS games

Login to post a reply

Server time is: 2025-05-22 12:08:24
Your offset time is: 2025-05-22 12:08:24