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.

AppGameKit Classic Chat / Some issues with 3D models

Author
Message
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 16th Nov 2016 08:28
I have some problems with using 3D models.

First is applying a texture to a model with animations. If I use SetObjectImage after loading the object with LoadObject the texture is applied correctly, if I load the object with LoadObjectWithChildren the texture is not applied.

I was using the D_Steele_rib2.X model from the FPSC model pack 3.

Anyone had this problem?

The second issue concerns playing an object animation in reverse. Using the same model I can get the animation to play forward, which opens the door, but I can't figure out how you get the animation to play in reverse, which would close the door.

Anyone know how to play 3D model animations in reverse?
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Nov 2016 09:13
Quote: "If I use SetObjectImage after loading the object with LoadObject the texture is applied correctly, if I load the object with LoadObjectWithChildren the texture is not applied."

With load object with children, it loads all limbs at separate objects so you'd need to texture all child objects yourself.
You could probably do this by calling GetObjectNumChildren on the loaded object, then GetObjectChildID( objID, childIndex ) to get the actual object number of the child, then you can call SetObjectImage on the child.
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 16th Nov 2016 14:10 Edited at: 16th Nov 2016 14:16
"Mobiius" wrote: "With load object with children, it loads all limbs at separate objects so you'd need to texture all child objects yourself."


That is not right! (Maybe mixing up meshes and objects)

1st LoadObjectWithChildren has to work like LoadObject when it comes to textures
2nd SetObjectAnimationSpeed() should work in reverse, but maybe SetFrame to the last frame of the animation is needed before
3rd the door object is broken (when compare to the scifiassaulttroop.X)

I am using
scifiassaulttroop.X

And it works with negative speed for reverse animation and also with loading it with children and using SetObjectImage() like I would do on LoadObject

So there could be a problem with the functions, but I would say, that the door objects are not created like the scifiassaulttroop.X






Used media and source the attachment

Attachments

Login to view attachments
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 16th Nov 2016 16:50
Awesome work guys.

Using Mobiius' technique of applying the image to all of the children worked.

Similarly, using f4ktor's animation code worked a treat. I now have the door textured band animated it seems you have to set the speed after triggering the animation to play. So I have to set the animation to play forward, set the object to the last frame and then set the speed backwards.

I agree that it's not elegant having to texture an object this way, but if it works I won't complain.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 17th Nov 2016 09:40
Quote: "LoadObjectWithChildren

Description

Loads an object from a file, currently supported formats are .X .3ds .md3 .smd .md5 .lwo. .ac .b3d .dae .3d .lws .ms3d .blend .m3 .obj and .ago If the model file contains a bone hierarchy or animation data then this will also be loaded and associated with the object. If the model file contains a scene graph containing multiple objects then these will also be loaded and stored in separate objects which can be discovered with GetObjectNumChildren. If you just want to load a single object without any bones, animation, or children then use LoadObject instead."

Sorry, what?

Quote: "Using Mobiius' technique of applying the image to all of the children worked."

Glad I could help.
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 18th Nov 2016 23:22

Mobiius wrote: "With load object with children, it loads all limbs at separate objects so you'd need to texture all child objects yourself."


in my understanding it is possible, that a model-file contains more than one object, and an object could have limbs, but these limbs are bones in a skeleton attached to meshes or vertices. If you use SetObjectPosition, you only have to move one object. Could be like FixObjectToObject maybe. But in the case my x-files from FPSC contained animations GetObjectNumChildren returns 1, and whithout animation: 0, but not the number of meshes or limbs. Mostly one object is one mesh. You can test it with the animated characters from FPSC, proof me wrong.
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 18th Nov 2016 23:34
@Mobiius, you are right, you have to texture all objects from the very complex "open the damn door"-scene.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 21st Nov 2016 09:32
It makes sense if you think about how AppGameKit loads objects, but I was only repeating the help files.

Login to post a reply

Server time is: 2024-11-24 23:00:24
Your offset time is: 2024-11-24 23:00:24