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 / Cutting a tree in half

Author
Message
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 20th Nov 2006 06:34
I have a theoretical idea for a gameplay mechanism that involves the ability to cut down trees. It wouldn't be 100% dynamic, but the idea is there. What I want to do is break a tree, which will be a .X model, into two pieces, cut horizontally. Because you could theoretically cut the tree at any height, I want to have it be a dynamic system that actually cuts the .X model into two pieces. How would I go about doing that? I'm assuming I'd use the make memblock from mesh command, then delete all of the verticies above whatever Y coordinant I give it. Does that sound right? Here are my main questions:

If I do this, is it possible to have both pieces of the tree still remain fully textured? I know that the command MAKE OBJECT FROM LIMB doesn't keep the texturing of the original object. This idea would be useless if either portions of the tree became untextured. Also, would it be fast enough to do in real time? Dividing a mesh in half, copying one half, etc etc. And my last question is, even though I'm pretty sure it can't be done, would it be possible to cap both holes of the tree? Considering that the tree will have a random width at a random height, I couldn't just make a cap object because I wouldn't know how big to make it (and there will be more than one type of tree as well). Thoughts on the problem?

dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 20th Nov 2006 07:35
For a quick workaround you could use the csg commands in dbp, then you could slice a chunk out of the object, however I'm not sure if that would seperate the limbs and would probably loose uv co-ords, if the tree trunk itself is very basic, say a 6 sided cylinder that is straight, then you could make a memblock from the mesh and find out which polys are being intersected by your weapon? and double the polys so that there is a seam there, the hard part would be to cap the holes on the newly cut area, unless you wanted some hollow bamboo style trunk.

Hallowed are the ori.
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 27th Nov 2006 04:02
Ok, just another bump. I'm going to start experimenting with ideas next week when I get back home, but other suggestions would be great.

QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 28th Nov 2006 15:53
bump again

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 28th Nov 2006 16:03
A tree made in your 3d package.
Using the 3d applications inbuilt CSG commands to slice the tree into 4 quarters.limbs

Using the Show and hide limb commands to show the 4 quarters of the tree.
The texture is applied to the tree already with the package, the limbs are already setup in the package
This method i think your heading down is probably not so good.


A distance function hiding objects from a radius distance is neat and efficient, it increases fps as your culling objects not in a given distance and allows for quick player turns 180 / 90 degrees.
Sometimes the simplest methods are usually the best,

QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 28th Nov 2006 18:12
Hmmm, limbs would probably be the simpelest solution. Actually, I kind of really like the idea, because I don't just have to use four limbs. I could use as many limbs as I want and not really increase the geometry by too much. I'd just have to create a calculation method to determine how many limbs the tree has and find out what to cut off. I'd probably have to end up cloning the object and making a top/bottom piece. Hell maybe I could even subdivide the parts you cut into smaller pieces...nah. I don't want to worry about that right now.

I think I'm going to *try* to go with this, but does anyone else have any input about the boolean idea?

Login to post a reply

Server time is: 2024-05-02 20:43:56
Your offset time is: 2024-05-02 20:43:56