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.

Author
Message
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 28th Aug 2011 19:12 Edited at: 28th Aug 2011 20:11
Ok so I've started my tree making program. Got it sort of working now with make mesh.

Use this code with model...


chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 28th Aug 2011 23:37
Quote: "Ok so I've started my tree making program. Got it sort of working now with make mesh"


Isn't it the same example I posted here ??


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

How will you add the rest of the tree ?. Is it going to have separated limbs, or you will manage a mesh with vertex position of the ring

Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Aug 2011 01:04 Edited at: 29th Aug 2011 01:19
Yeah, you gave me the code to help me build a tree, so it's the code I'm using to build a tree... lol. This is what I have so far...



Now I am trying to draw the next layer, and it isn't putting the vertex in the right place. Then I will join the boxes up with vertex when it is built. I'm having problems with Up/Down, and rotate the model, and get the vertex. The only way I have managed to get Up / Down to work is with offset limb, but it doesn't work twice for some reason. The only way to rotate the model is to rotate it then build another mesh from it.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 29th Aug 2011 01:30 Edited at: 29th Aug 2011 01:31
Ok , I'm glad it can help, but how will you add more detail to your tree ?


Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Aug 2011 01:53 Edited at: 29th Aug 2011 03:17
Quote: "Ok , I'm glad it can help, but how will you add more detail to your tree?"


Once I get a simple tree working I will add more detail. It's just a matter of moving the boxes around.

EDIT: I still can't add a limb, offset it, and get it to draw the boxes for the next limb.

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Aug 2011 17:39
Finally got most of the limbs in the right place, but one of my limb pivots is still not in the middle of the limb. The one facing the camera is in the middle of the tree. Could somebody please move this pivot to the centre of the limb. I have attached it for download.



Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Aug 2011 19:34 Edited at: 29th Aug 2011 19:34
Yay I've fixed it. It had about 3 dummy limbs which were messing it up. I hope somebody knows how you join all of these boxes up with meshes, because I haven't figured that out yet.




chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 29th Aug 2011 19:51 Edited at: 29th Aug 2011 19:54
Quote: "I hope somebody knows how you join all of these boxes up with meshes"


You can use IanM matrix1utils plug in and make a plain with the vertex you need to play. Take a look to this code. I can help you






Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Aug 2011 19:58 Edited at: 29th Aug 2011 19:59
Ace Thanks! Ahhh faces, are plains, I didn't know that. Then this saves as an X model?

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 29th Aug 2011 20:13
Quote: "Then this saves as an X model?"


You can save as .x or .dbo

Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 30th Aug 2011 16:01 Edited at: 30th Aug 2011 16:14
My next problem is making sure that boxes are not inside trees...

I need to check for Object inside Object. I couldn't find anything with the search. So does anyone know of this sort of check, and it's not spherical, it's more random... object inside flat disc code might work if anyone knows that, but the disc can be rotated, so that gets complicated too.

See the bright green discs, I want to make sure that the boxes are not inside those.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 30th Aug 2011 21:14
Are you making the tree ring by ring?...I can't understand what you try.

Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 30th Aug 2011 22:07 Edited at: 30th Aug 2011 22:10
I'm making a tree, ring by ring so that all of the branches are part of the tree. When you look at a lot of tree models, the branches are just placed on the models, and it doesn't look right. My models will look real even close up. The extra boxes will happen when I try to add branches, and roots, and knots to the tree. I need to get rid of the extra boxes. I've tried to make trees in ZBrush, and pulling out branches from the trunk makes a mess. So I'm making this program instead.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 30th Aug 2011 22:19
Ok ...so if you make you tree let's say ring by ring, you will have to make all upper vertex of every ring to be placed on every lower vertex of new ring , is that right? . In that case depending on how real you need your tree, you can use triangles ,meshes or even cylinders with vertexdata.

cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 30th Aug 2011 22:39 Edited at: 30th Aug 2011 22:47
Ok thanks! But I still need to get rid of the extra boxes that aren't needed. They are the coordinates. Think of 4 boxes making a square, they make the coordinates. This tree actually grows out of the ground on it's own, so I don't control where the boxes are placed. That's why I need to clip them off.

Actually, it's amazing to watch it grow.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 30th Aug 2011 23:49
Could you post your code?



Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 31st Aug 2011 00:35 Edited at: 31st Aug 2011 00:40
I want my trees to be unique to my game so posting the code would mean that I could end up with the same tree as someone else, which would ruin the originality. But I will put some real trees up for sale when it's finished. Really cheap.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 31st Aug 2011 00:56
Quote: "I want my trees to be unique to my game so posting the code would mean that I could end up with the same tree as someone else"


Does it mean than you don't need any help just in case the code falls into the wrong hands? Won't you use any part of code that can help you with your project ?

Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 31st Aug 2011 01:06 Edited at: 31st Aug 2011 01:21
I just wondered how to check that an object is inside another object.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 31st Aug 2011 01:50
Have you tray with collision command?

Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 31st Aug 2011 02:01
I will try it.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 31st Aug 2011 04:31 Edited at: 31st Aug 2011 04:32
I made a piece of code to make the tree trunk where you can adjust the height and diameter of each portion. I use the same as you...boxes to adjust the mesh all the way up to the top of the tree. If you want, I can share the code for free




Cheers.

I'm not a grumpy grandpa
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 31st Aug 2011 04:50
@ chafari Hey bro, I would love to see your tree code.

@ Pincho Hey man, that code you wanted is now on my thread. Cheers.

http://forum.thegamecreators.com/?m=forum_view&t=188775&b=1
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 31st Aug 2011 05:00 Edited at: 31st Aug 2011 05:02
@JackDawson

Let me translate into english and rig it a bit, as it is a mess for now I'll post it tomorrow ...right?


Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 31st Aug 2011 05:11 Edited at: 31st Aug 2011 05:14
Quote: "I made a piece of code to make the tree trunk where you can adjust the height and diameter of each portion. I use the same as you...boxes to adjust the mesh all the way up to the top of the tree. If you want, I can share the code for free "


It looks good yeah. Then it needs to bend to create the branches. I have this so far...



Then I'm am sending more up through the tree. And that's where deleting the extra boxes comes into it.

JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 31st Aug 2011 05:16 Edited at: 31st Aug 2011 05:18
@ chafari Sounds good man. I translated your last code that is in the current code I put on the thread above. Just follow the link and you'll see part of your code gutted for my own needs. Its the Heightmap generator. I used the basic generator and then changed it into a function I can call and then use it to save heightmaps in a folder. And with your code I can call any heightmap I want in. I can now make as many heightmaps as I want on the fly as I walk around. That's the idea at least. I hope to have it fully working by tomorrow. So yea, I look forward to your tree. Thanks a lot again my friend.

And yes, you were credited yesterday on my first post.

@ Pincho After looking at the picture you have here just now, It dawned on me what your trying to do. And yea, the code I have will allow you to do that. Just use my backdrop and use your matrix with that. You can then apply a texture to it.

"Son, I crap bigger then you !"
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 31st Aug 2011 05:26
@Pincho Paxton
Your picture looks good aswell. My function rotate branches too, and now I'm trying other function to joing branches.


@JackDawson.
Ok , so tomorrow I will post the code. By the way, I saw your terrain example, it was ok, but as somebody comment, the camera jumps a bit some times. I will look in my memories and I will show you one of my matrix editor.


Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 31st Aug 2011 05:44
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 31st Aug 2011 06:08
@ Pincho NICE PICTURES of those trees. Wow. I hope to see your project take off.

@ chafari Yea, sadly I am aware of the camera jitters. I have seen it in a lot of terrain creators though. So I was not sure what that is. It seems to be a common problem for a lot of people as I did a search on the forum for an answer. But all of them are talking about following an avatar or hidden object with your camera behind it or something. I am not wanting to add that. I want just a free floating camera. I may have to write in a routine that checks the surrounding yPos# and compare an average height based on the current yPos# and the outer two. I will call them rings because they are the coordinates that sound the camera. So with two rings out and it finds a common average number, I should be able to smooth out the camera as it moves. I just hope its not too intense on the CPU. We'll see.

"Son, I crap bigger then you !"
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 31st Aug 2011 16:32
Yay, I have randomness working. What I am currently thinking about is the UV map on the trunk. The branches can all share the same UV map (I don't mind that) But the trunk needs to be a complete UV map. So that the trunk can have details drawn on it all over. So how do you make the trunk's individual polygons all share the same UV map?

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 31st Aug 2011 16:53
Every ring of mesh has its own UV. We have to use seamless texture to have smooth joints. I'm fighting with that too. For some reason, when the piece of trunk is to small to make a smooth bend, the texture scale in a bad way. I have it more or less succeeded, but still not quite right. I'll post a preview code later on.

Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 31st Aug 2011 18:03 Edited at: 31st Aug 2011 18:17
I don't think I can use rings. Too hard to connect to branches. I need a shape that has corners that isn't completely square, but deformable. Maybe triangles. Plains would be better if I could alter the 4 corners individually.

I can't use seemless textures either, I need one big texture. I can test it with seemless textures, but then I want to Photshop the tree.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 31st Aug 2011 20:04 Edited at: 31st Aug 2011 22:23
Quote: "I can't use seemless textures either, I need one big texture"


The real tree bark, looks somewhat repetitive, so we could use seamless textures. You could use triangle, they are esy to manage, but the most hart, is adjust all UV of all triangles. I'v got my own formula especially when we join many triangles

@JackDawson @Pincho Paxton

Here's my piece of code although I need the function for the union of branches...I'm on it.







Cheers.

I'm not a grumpy grandpa
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 31st Aug 2011 20:17 Edited at: 31st Aug 2011 20:19
Quote: " It seems to be a common problem for a lot of people as I did a search on the forum for an answer"


@JackDawson
Download this piece of code, I have neve had this problem with the camera on a matrix . In this code, you can see how to texture whole matrix with a big texture. It costs a bit of texture loading because its a big one.



Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 31st Aug 2011 22:17
Well, managed to put JackDawson's matrix in my tree program. So thanks Jack!

@Chafari, your texturing seems to be working, is that a complete UV, or a repeated UV?

I have got more random shapes working. Now it works with a seed, or Timer()



chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 31st Aug 2011 22:27
Quote: "is that a complete UV, or a repeated UV?"


It is a repeated texture scaled to the object.
Tell just one thing, do you use a mesh in your object or do you use triangles ? .

I you use triangles, you have to use the texture in every two triangles to make it work correctly.

Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 31st Aug 2011 22:36 Edited at: 31st Aug 2011 22:39
I haven't decided what to use yet. Whatever wraps around the trunk, and branches at the same time. The connections are the tricky bit. How do you wrap a mesh around the tree, and branch? The thing is that you have a 'Y' shape, and I need it connected as one object.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 31st Aug 2011 23:18 Edited at: 31st Aug 2011 23:29
we must match the last vertices of the branch with some vertices of the main trunk. It's not too difficult.

Cheers.

I'm not a grumpy grandpa
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 31st Aug 2011 23:29 Edited at: 31st Aug 2011 23:39
Sorry for double post. I need it to upload image.No one could say that is not the same trunk.





Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 1st Sep 2011 02:37 Edited at: 1st Sep 2011 02:43
Yeah that's really good! It just needs a tiny amount of wider connections to the trunk. That should clean up the lumpy bits. So if you are connecting 12 boxes to 12 boxes at the end of the branch you could try removing 12 boxes from the trunk, and that will widen the joint.

WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 1st Sep 2011 02:38
I've been watching this with interest. Nice work so far. I've had some ideas too but no time recently to try anything out.

Warning! May contain Nuts!
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 1st Sep 2011 03:19
Quote: "I've been watching this with interest. Nice work so far. I've had some ideas too but no time recently to try anything out"


Thanks...that's something like a chanllenge of doing it with Dbpro

@Pincho Paxton
Even in a real tree, the union of the branches don't are so neat ...some imperfections looks kool

Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 1st Sep 2011 04:01 Edited at: 1st Sep 2011 04:10
Yeah tree branches join up with lumps. I'm still going to make my version smooth though, and if I want lumps add them later. I just realised that I will need to check for collisions between branches, and move them out of the way. I wonder if it's possible to bake in some shadows when branches are close together? (Maybe too much work)

JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 1st Sep 2011 06:32 Edited at: 1st Sep 2011 10:26
@ chafari Hey bro, thanks for the Tree Ring code. I got it to work !! Thanks for the info on that tree rendering. Nicely done.

I was also able to get my terrain demo working and the camera is no longer "jittering". Cheers.

@ Pincho Thanks for the pic. My "world" looks great with your tree. I cannot wait to see your finished program.

EDIT : @ chafari I took a picture of your tree program working. Here you go.



"Son, I crap bigger then you !"
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 1st Sep 2011 12:37
Quote: "I wonder if it's possible to bake in some shadows when branches are close together?"


Perhaps with set shadow shading on, if not with darklights and lightmapping.

@JackDawson Nice trunk ... Enjoy it !! now I have to debug the function for joining branches and the one to create the leaves.

Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 1st Sep 2011 13:34
@JackDawson and @chafari it looks very nice!

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 1st Sep 2011 20:17 Edited at: 1st Sep 2011 20:18
Been working on the GUI...



chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 1st Sep 2011 20:59
@Pincho Paxton
Have you got a functional mesh working or that is just an image?

Cheers.

I'm not a grumpy grandpa
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 1st Sep 2011 21:37 Edited at: 1st Sep 2011 21:37
Haven't put the meshes on yet, but it's not an image, it's the tree without a mesh, a preview before you click render.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 1st Sep 2011 22:33
Is it going to be a render programm or will you be able to export/save dbo or .x files ?


Cheers.

I'm not a grumpy grandpa

Login to post a reply

Server time is: 2026-07-10 16:33:35
Your offset time is: 2026-07-10 16:33:35