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 / [SOLVED] [need help]3d object stands on the air above the ground

Author
Message
harry1315
4
Years of Service
User Offline
Joined: 16th Apr 2020
Location:
Posted: 22nd Jun 2020 04:24 Edited at: 22nd Jun 2020 21:12



if I use SetObjectScalePermanent(obj1,0.1,0.1,0.1) or don't use scale, the position of object is on the air.



if I use SetObjectScale(obj1,0.1,0.1,0.1), the position of object is right but when plays the animation, the object becomes out of shape.

Attachments

Login to view attachments

The author of this post has marked a post as an answer.

Go to answer

ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 22nd Jun 2020 11:20 Edited at: 22nd Jun 2020 11:38
I'm only learning AGKS so don't know if this will help.

When using the physics, try to keep objects and their collision shapes a size of 4 units or greater otherwise the physics engine won't play nice.

Also test with a few different models.

One more thing, if you use LoadObjectWithChildren as is normal for loading animated models, use SetObjectScalePermanent instead of SetObjectScale.
Never play leap frog with a unicorn.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 22nd Jun 2020 11:32 Edited at: 22nd Jun 2020 11:33
sounds like a scale factor issue
Create3DPhysicsWorld ( scaleFactor )
try a small scale factor like 5 for example the default I think is 40

btw nice models

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
harry1315
4
Years of Service
User Offline
Joined: 16th Apr 2020
Location:
Posted: 22nd Jun 2020 15:42 Edited at: 22nd Jun 2020 17:23
Thank you for all your replies.
But Create3DPhysicsWorld(5) does not work in my situation.
However, I found that the problem is my model(T.x).If I change model using another software, the problem is disappeared.
So it is the model problem.

Now I have another question, I am thinking about not using Create3DPhysicsWorld(),but the main step is that I need to get the y coordinate of the ground plane where the object is place for.How can I get it?
just like getplanepositionY(positionx,positionz)
I searched the command list for getxxxxxxxcommand, I found GetObject3DPhysicsContactPositionVector is closed to my quedtion but it does not return the y coordinate.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 22nd Jun 2020 16:37
of ofcourse your pivot point

GetVector3Y ( vectorID ) should help

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
harry1315
4
Years of Service
User Offline
Joined: 16th Apr 2020
Location:
Posted: 22nd Jun 2020 18:16 Edited at: 22nd Jun 2020 18:19
if terrain.fbx is my map, I want to get the top y coordinate of terrain from a position where t.x(my character model) is place(stand) on,how can I do?
Something like GetVector3Y (vectorid or objectid).
And GetObject3DPhysicsContactPositionVector(obj,obj1,vector) return 1 if obj and obj1 are contacted, I want to get the point where they contacted.
harry1315
4
Years of Service
User Offline
Joined: 16th Apr 2020
Location:
Posted: 22nd Jun 2020 19:34
This post has been marked by the post author as the answer.
The problem is solved.
The reason why the model stands on air is because the model has relative position inside it's properties.
Change the model's relative position to absolute position, the model now not stands on air anymore.

Login to post a reply

Server time is: 2024-04-20 13:38:20
Your offset time is: 2024-04-20 13:38:20