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 / What is the deal with transporting blender scenes into agk

Author
Message
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 30th Dec 2018 05:32 Edited at: 30th Dec 2018 05:36
I have several objects in blender, but when I save the individual objects so as I can load them into AGK
The scale is wrong, The positionings is off and the rotations are wrong. I thought if I just centred there
offset and got there position data that would work in AppGameKit but its not correct
fubar
puzzler2018
User Banned
Posted: 30th Dec 2018 09:42 Edited at: 30th Dec 2018 09:43
The function for the LoadObject has some scale functionality in its code it seems from the GitHub info regarding adjusting/scaling a model to match the height of it#

Have you tried one with my ObjLoader at all?
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 30th Dec 2018 09:59
Haven't tried your object loader yet? The scaling is easy enough to fix. but the positioning is driving me crazy, ive tried rotating the objects in blender
even tried swapping x and z locations but no avail, I thought I could use blenders world cords and they would be pretty close to what I wanted as I
made an object loader function. I have to scale by about 10 to get them close and the map is all rotated in wrong positions. Just thought someone
might have an easy solution with some explanation

fubar
puzzler2018
User Banned
Posted: 30th Dec 2018 10:14
I quickly built two cubes , location is off and joined them together in blender and then loaded them with AppGameKit loadobject

Its pretty dam closely perfect to me.
Do you have some screen shots or a video to show this?

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 30th Dec 2018 10:28 Edited at: 30th Dec 2018 10:33
That is after I exported the models facing the camera and all objects have been centred
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 30th Dec 2018 10:31 Edited at: 30th Dec 2018 10:43



track.Layout



http://users.tpg.com.au/subarpk/test2.rar
fubar
puzzler2018
User Banned
Posted: 30th Dec 2018 10:31
ok cool - bear with me whilst i try and re-create the issue with your scales and rotations
puzzler2018
User Banned
Posted: 30th Dec 2018 10:33 Edited at: 30th Dec 2018 10:34
Ok ive just seen

SetObjectPosition(model.id,model.posX,model.posY-5,model.posZ)

Why do you have -5 on the Y??

Try change this by removing -5

Its a little like FixObjectToObject - always position objects with 0,0,0 when fixing them
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 30th Dec 2018 10:46 Edited at: 30th Dec 2018 11:02
That just lowers it into camera view I just shared the rar file
There is a object called "track.obj" that's how it should be viewed
Then there is a object called "trackb.obj" how I rotated it
The rest are the pieces I load with my function


I figured if I scale and increase the x y z factors later it should be the size I want
but the present values are directly taken from blender. And when I figure out a
method of transferring objects placed in blender into agk placed I just may make
the map allot bigger.
fubar
puzzler2018
User Banned
Posted: 30th Dec 2018 11:21
Damm I see what you mean - I see all the individual OBJs in Blender have local Location 0,0,0 - Rotation 90,0,0 and scale 1.0,1.0,1.0 in Blender, (Transform) but when i Import some of them - they go to the respective place - as if the global location/scale/rotation is incorect on each object - this is Translate.

Bear with me, ill see if the Translate of each object should be 0,0,0
puzzler2018
User Banned
Posted: 30th Dec 2018 11:45
I just removed SetObejctPosition altogether - they look levelled out now


Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 30th Dec 2018 11:52
Thanks puzzler your a legend, lol im sure I tried that before but I kept changing rotations etc so much
ide prob messed it up
fubar
puzzler2018
User Banned
Posted: 30th Dec 2018 17:56
Your welcome, Will be really nice to see this come to life one day

Login to post a reply

Server time is: 2024-04-19 08:31:51
Your offset time is: 2024-04-19 08:31:51