Fully customizeable 3d object
by Thomas Pereira · in Torque Game Builder · 06/11/2006 (10:53 am) · 17 replies
Alright, just to set a little background. I know a fair amount on the creative side of 3d graphics - that is to say, I can create just about any model and make it look good. I am decent with animation, but very inexperienced with skinning (I never really bothered to learn about it...never really used 3d models for anything but pre-rendering, and it was all really hobby work). Anyway, I've look all over the place for this, and I really would appreciate a direct answer.
I know changing skins is easy, which would allow you to customize things. However, I want to have things attached to a model seperately, like arms, or wings, or whatever the hell. Seperate models that are attatched together to form a single object. Then, I want to be able to change individual models to other models. So I could have a guy with wings like an angel with a halo on the his head, then change it to wings like a devil with horns on the head, for example.
To sum up what I'm asking, I would just like to attatch several models into one in order to form a complex customizable 3d object. I would like to know if there is another word this feature goes by, and if it is currently possible in TGB. Sorry if I am unclear, I will clearify if needed. Thank you.
I know changing skins is easy, which would allow you to customize things. However, I want to have things attached to a model seperately, like arms, or wings, or whatever the hell. Seperate models that are attatched together to form a single object. Then, I want to be able to change individual models to other models. So I could have a guy with wings like an angel with a halo on the his head, then change it to wings like a devil with horns on the head, for example.
To sum up what I'm asking, I would just like to attatch several models into one in order to form a complex customizable 3d object. I would like to know if there is another word this feature goes by, and if it is currently possible in TGB. Sorry if I am unclear, I will clearify if needed. Thank you.
About the author
#2
[edit: duh- I meant TGE does have the functionality, and TGB does not -alex]
06/11/2006 (1:56 pm)
By "TGE does not expose this functionality" i mean there doesn't appear to be a way to do it in torquescript. Probably is not a problem in C++ though.[edit: duh- I meant TGE does have the functionality, and TGB does not -alex]
#3
06/11/2006 (11:10 pm)
So basically what you're saying is it is currently not possible without expansion to the source, correct?
#4
But it's a good idea for a feature. I have also thought about the utility of being able to mount t2d sprites onto the 3d object's nodes. The rendering might get a little tricky with that though.
I have also been thinking about using a 3d object , and using it's texture as an t2d animated particle effect. So I could "explode" 3d object by feeding it's texture into the particle effect of t2d. I don't know if that makes sense. I will make a demo of it sometime.
06/11/2006 (11:19 pm)
Yes but it's not authorative- you should double check me and read the TGB docs, maybe even peruse the source code. But it's a good idea for a feature. I have also thought about the utility of being able to mount t2d sprites onto the 3d object's nodes. The rendering might get a little tricky with that though.
I have also been thinking about using a 3d object , and using it's texture as an t2d animated particle effect. So I could "explode" 3d object by feeding it's texture into the particle effect of t2d. I don't know if that makes sense. I will make a demo of it sometime.
#5
06/12/2006 (5:27 pm)
Yes, it looks like you have the same thing in mind that I do. Damn that is a shame. I will look into it more I guess, but it seems like a source deal. Well, maybe I should switch this thread to future improvements. Anyway, thanks for your help.
#6
06/18/2006 (9:34 pm)
If possible, I would really like a direct answer to this question. Are the commands there to do what is described above? If not, how difficult would it be to add it?
#7
06/18/2006 (11:14 pm)
How difficult to hack this into TGB? It depends on your skills and how much you need/want the feature. From what you describe it sounds like you need a 3d engine (TGE) more than TGB.
#8
Also, I understand what you mean, Alex, about the particle effect. It sounds great! But I think it'd be hard to do, as a single texture can contain many objects. How would you tell TGB where to cut it so that it looked like a piece of the 3D model? You'd probably have to use an alpha on the texture itself, covering all unused areas.
06/19/2006 (9:46 am)
On a somewhat related note, is it possible to customize a 3D object's texture? For instance, say I wanted a guy to be red instead of blue, could I adjust the hue of his texture, like I can for 2D textures? If that's possible, could one put, say, the pants texture on another image file, then adjust only that file to change only the color of his pants? This seems impossible with the current code.Also, I understand what you mean, Alex, about the particle effect. It sounds great! But I think it'd be hard to do, as a single texture can contain many objects. How would you tell TGB where to cut it so that it looked like a piece of the 3D model? You'd probably have to use an alpha on the texture itself, covering all unused areas.
#9
06/19/2006 (9:50 am)
You can select different skins for your models. AFAIK, there is no easy hue variation scheme in place.
#10
Well, this feature is all I really need as far as 3d goes. I wanted to make my current idea in a 2d environment with 3d characters/some objects. In other words, the majority of the graphics would be 2d, and in addition the 1st level of my concept is for a side scroller. To me, it doesn't seem practical to use a full 3d engine for something that I will be mainly using 2d on.
In addition, I would think having these features for 3d objects is basically a must have. It confuses me a great deal why something like this isn't built it. I think I would have rather seen that annotated somewhere more thoroughly rather then simply saying there is 3d support. I may have gone with TGE instead, since I will most likely be using that if the 2d engine doesn't have the support I need. Either way, it looks like I will need TGE anyway if I plan on modding the TGB engine.
What a hassle.
06/19/2006 (5:21 pm)
Alex Rice:Well, this feature is all I really need as far as 3d goes. I wanted to make my current idea in a 2d environment with 3d characters/some objects. In other words, the majority of the graphics would be 2d, and in addition the 1st level of my concept is for a side scroller. To me, it doesn't seem practical to use a full 3d engine for something that I will be mainly using 2d on.
In addition, I would think having these features for 3d objects is basically a must have. It confuses me a great deal why something like this isn't built it. I think I would have rather seen that annotated somewhere more thoroughly rather then simply saying there is 3d support. I may have gone with TGE instead, since I will most likely be using that if the 2d engine doesn't have the support I need. Either way, it looks like I will need TGE anyway if I plan on modding the TGB engine.
What a hassle.
#11
Anyways- Thomas, ask yourself this: do most 2D game engines have any sort of 3d objects support? No? So...
If I were in your shoes, I would buy a book on C++ and buy a license to TGE to see how it's implemented in that source code, and then I would get to work.
You see TGB is a great value proposition for many of us, regardless of whether your particular idea is easy to implement.
I hope this helps
06/19/2006 (5:42 pm)
Thomas. Sorry if you thought I was an authority on this or something - I am just another guy trying to make my dream come true and writing my 1st game. I happen to have used both TGE and TGB so I am at least a little familiar with the .dts format and what it supports for 3d objects. Anyways- Thomas, ask yourself this: do most 2D game engines have any sort of 3d objects support? No? So...
If I were in your shoes, I would buy a book on C++ and buy a license to TGE to see how it's implemented in that source code, and then I would get to work.
You see TGB is a great value proposition for many of us, regardless of whether your particular idea is easy to implement.
I hope this helps
#12
That's what I'm doing, although I do know enough C programming to hack some features into the engine if I really needed to.
06/19/2006 (5:44 pm)
Or just take the TGB features as they are and say "OK what kind of game can I make with this" :-)That's what I'm doing, although I do know enough C programming to hack some features into the engine if I really needed to.
#13
The mount point, and mount transform information is contained in the TSShapeInstance. All "mounting" an object really does is multiply another matrix onto the world transform stack. While this code is in ShapeBase, you should be able to implement it relativly quickly.
To get the transform for a mount point node:
Then, multiply that matrix by the world matrix for the object, and you will have the new object offset correctly. You are probably going to have to mess with scaling, if the objects need to be scaled.
06/19/2006 (7:13 pm)
DISCLAIMER: This is not something I have tried...it's just off the top of my head (mostly).The mount point, and mount transform information is contained in the TSShapeInstance. All "mounting" an object really does is multiply another matrix onto the world transform stack. While this code is in ShapeBase, you should be able to implement it relativly quickly.
To get the transform for a mount point node:
MatrixF mountTransform = some_TSShapeInstance->mNodeTransforms[node_index];
Then, multiply that matrix by the world matrix for the object, and you will have the new object offset correctly. You are probably going to have to mess with scaling, if the objects need to be scaled.
#14
Pat, thanks for the info. I will see what I can do with that. Should really be all I need, if it works properly.
06/19/2006 (8:58 pm)
Alex, the first paragraph was directed to you, the rest was on the side. I apologize for not making that a little more clear X_X.Pat, thanks for the info. I will see what I can do with that. Should really be all I need, if it works properly.
#15
Plus it would be cool. And I could steal it!
06/20/2006 (8:01 am)
Upon re-reading the original post, I would strongly recommend picking up the TGE license and accesing several of the resources on in-game bone manipulation, shape deformation, and the forum topics on the trials and tribulations of mounting body parts and making them play nicely. Then take that knowledge and put it into TGB's 3DShape layer. It is not a trivial thing to do by any means, but it was beyond the scope of the original 3DShape intention.Plus it would be cool. And I could steal it!
#16
06/20/2006 (11:58 am)
David, it looks like that is what I will have to end up doing eventually. I think it would be a fruitful learning experience in addition to accomplishing my current goal.
#17
The functionality you mention above is part of different classes (Mounting comes from ShapeBase for example, which "has a" TSShape, but isn't the TSShape itself), and by the time we brought over all of the functionality and parent classes that provide the levels of functionality for mounting to work in 3Space, we'd be handing over TGE as well as TGB....it's actually quite a bit of functionality required to have mounting a 3D object to another 3D object, and out of scope of the concept of a 2D engine such as TGB.
Yes, you can certainly write your own, or buy TGE and port over what you need, but it wasn't (and isn't) going to be part of stock TGB.
06/20/2006 (3:56 pm)
As a background thought, what was brought over into TGB from TGE is the TSShape, and the basics required to play animations from script.The functionality you mention above is part of different classes (Mounting comes from ShapeBase for example, which "has a" TSShape, but isn't the TSShape itself), and by the time we brought over all of the functionality and parent classes that provide the levels of functionality for mounting to work in 3Space, we'd be handing over TGE as well as TGB....it's actually quite a bit of functionality required to have mounting a 3D object to another 3D object, and out of scope of the concept of a 2D engine such as TGB.
Yes, you can certainly write your own, or buy TGE and port over what you need, but it wasn't (and isn't) going to be part of stock TGB.
Torque Owner Alex Rice
Default Studio Name