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 / How to add mesh to object? (without plugins)

Author
Message
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 26th Mar 2012 18:10
I'm trying this code (it may contain errors as it ripped from source)

Result is one copy of test.dbo as I can see.
I need to make single object (preferably without limbs) from randomly positioned dbo objects.
Blazer596
14
Years of Service
User Offline
Joined: 26th Mar 2012
Location: Winton,CA
Posted: 26th Mar 2012 19:00
Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 26th Mar 2012 20:49 Edited at: 26th Mar 2012 20:49
You need to offset the vertices after adding the object, add mesh to vertexdata will add the mesh at 0,0,0:


mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 26th Mar 2012 22:30 Edited at: 26th Mar 2012 22:34
Max P, thanks!!! I'll need some time to merge code with my source, but I already see that it will work! And two more things I want to make clear:
1. Will this vertex manipulation be faster than "add limb" feauture?
2. My mesh has two UV channels: regular texture and detail map. Although I am planning to add vertex colours through dark basic. Although I am scaling down detail map (as objects has different sizes). Phew... Will all this extra data be kept after these mesh manipulations? Or how to?

p.s. my goal is to add many bullet decals to the walls with minimum perfomance impact
Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 26th Mar 2012 22:53
Quote: "Will all this extra data be kept after these mesh manipulations?"

Haven't tested it, but I think it won't be a problem, just make sure all the meshes have the same fvf format.

I did a little speed test with adding 1000 cubes:
meshes:
280 ms to create, runs at 4300 fps
limbs:
33 ms to create, runs at 370 fps

mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 27th Mar 2012 11:47 Edited at: 27th Mar 2012 12:26
My test with lightbulbs (as dbo objects) failed - no vertices added past ~65000 count. Is there any way to avoid that?

edit: maybe memblock using?
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 27th Mar 2012 15:12
Quote: " Is there any way to avoid that?"


No, that's the DBPro limit for a single limb I believe.
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 28th Mar 2012 14:31 Edited at: 28th Mar 2012 14:32
To make decals 65k vertices is enough for me.
But what can you advice if I need to make many small objects (rubbish on floor) with physics?

P.s. I can unwrap all these small things into one texture.

Login to post a reply

Server time is: 2026-07-09 17:42:55
Your offset time is: 2026-07-09 17:42:55