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 / Bending a 3d box on the fly

Author
Message
noturno
15
Years of Service
User Offline
Joined: 9th Mar 2011
Location:
Posted: 21st Mar 2011 03:54
Dears, I've been trying to bend 3d objects in DBP for a few days. What I would like to do is, for instance, create a 3d box and bend it (with non-defined curves, but it can also use benzier or cubic curves). Think of creating a wall in a sim game and then curving it: that would be an example of a application of what I am trying to learn.

Of course, it would not be possible to do in DBP directly on the 3d box: we should first make part objects, link them and use memblocks. Them create a mesh. But I am very new to the programming with the 3d spacial objects. So, if anyone can help me with any tips, examples or pieces of code, I will be very thankfull to have a start.


Important: looking for usefull tips on that issue, I found an old thread in the forum that worth to be continued: http://forum.thegamecreators.com/?m=forum_view&t=17898&b=1

In that thread, it was asked by CompuWiz how to bend a cilinder with a benzier curve. Van B started with some very good ideas, but the conversation in the thread ended soon. I was wondering if we could use some of the insgiths and continue them here.
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 21st Mar 2011 06:54
You should look into "bezier surfaces".

Also... You'd need to have a fine mesh, so a cube, instead of having 6 faces (2 tris per face = 12 tris), you'd have each face be subdivided a bunch, like this:


So... FIRST THING'S FIRST: Figure out how to make a subdivided cube like the above. Probably using the vertexdata and memblock mesh commands. I'm no good with them, otherwise I'd help you more.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 21st Mar 2011 12:45 Edited at: 21st Mar 2011 12:48
Have a look here:

http://forum.thegamecreators.com/?m=forum_view&t=181531&b=1

I'm not a grumpy grandpa

Login to post a reply

Server time is: 2026-07-17 13:59:38
Your offset time is: 2026-07-17 13:59:38