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 / Blender and AGK

Author
Message
wargasmic
17
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 17th Mar 2013 21:46
Does anyone here use blender for their agk projects? I'm just wondering what a good scale is to use.
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 17th Mar 2013 21:56 Edited at: 17th Mar 2013 21:56
choose the scale you want ... 3D World Size is a very relative thing. You can work inside a 3x3x3 world (with objects scaled at 0.0001) or in a 100000x100000x100000 ... just take care about the float precision :p

For example i'm working on a 4096x4096x4096 world in my current project. It depends on what you want


And Blender or not blender ... it's the same for all modeling software
wargasmic
17
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 17th Mar 2013 22:04
Well I'm trying to load in an obj file, but it's not showing up. I'm not sure if that's because I'm not loading the file in properly or if it's because of the scale being too big/small to see the object.

I'm working in a 120x120 world in agk and what I really need to know is how 1 blender unit converts to 1 unit in agk.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 17th Mar 2013 22:06
Yes, I use Blender.

Currently only for 2D stuff from 3D objects.

The beauty of Blender is that you can make your project as big as you want and then scale it down for the final output (if you are just doing images as your output.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 18th Mar 2013 08:24 Edited at: 18th Mar 2013 08:25
you can make a 1x1 cube in agk and then load a 1x1 cube from blender as compare. 1 meter as 1 unit i use myself for a good scale inside a game.
wargasmic
17
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 18th Mar 2013 17:18
I don't know if I'm missing something, but I cant see my models in agk.

In blender I have created a cube to test, applied a material and texture, triangulated the faces then exported as .obj. Ive tried scaling the cube between 1 and 1000 before exporting, and have also played with the scale in agk, but the cube is never visible.

I retried in a test case, to confirm it wasn't a problem with my engine code, and the model still doesn't show.



The media directory is in the same directory as the application, and the files are in there as needed. There is also a .mtl file for the model, although I think I read that's not needed anyway.
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 18th Mar 2013 17:23
I'm a novice at this stuff, but my objects exported from blender work just fine.

I can tell you the options I have clicked when exporting to .obj in blender:

Apply Modifiers
Include Edges
Include Normals
Include UV
and
Objects as OBJ objects

Never bothered with scale myself

My hovercraft is full of eels
wargasmic
17
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 18th Mar 2013 17:39
lilpissywilly, what is your agk camera position set to?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 18th Mar 2013 18:14
Tier 2 does not default to the media directory. It defaults to the same directory as the executable.

In order to keep inputs separate, I do use a media directory under the executable directory and I always add '/media/' in my load calls.

Add '/media/' at the start of the names for the images and objects and see if that fixes the problem.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 18th Mar 2013 19:04 Edited at: 18th Mar 2013 19:08
you can use if GetFileExists( szFile )=1 to be sure the file is there and else show a message.
but in tier1 i get a message failed to open if the .obj file is not found.
maybe also useful SetObjectCullMode( objID, mode ) mode 0=both front and back .
also importend is the object center point,
some exports use the world center as middle point.
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 18th Mar 2013 19:08
Quote: "lilpissywilly, what is your agk camera position set to?"


I initiate something like this:



Set the object to position 0, 0, 0, and about size 10-20ish.

Tell you what, I made a tiny program before to check objects I had made, I'll include that in a .rar here for you to view. Includes a test object and you can rotate it with arrow keys on ze keyboard.

My hovercraft is full of eels

Attachments

Login to view attachments
wargasmic
17
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 18th Mar 2013 19:44
DOH!

AncientLady to the rescue, again!


Quote: "Tier 2 does not default to the media directory. It defaults to the same directory as the executable."


That was the problem all along

Thanks to everyone who replied. We(I) could do with you guys in the IRC channel
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 18th Mar 2013 20:22
I thought about going onto the IRC channel, but decided that I'd stick with the forum.

My reasoning is that everything gets saved hear and can be searched. And that makes information available to everyone almost perpetually.

Glad to be of help.

Happy Programming!

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
wargasmic
17
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 22nd Mar 2013 17:54
Well I managed to export a model the other day and it worked fine, but i cant seem to do it again

Can someone who exports to obj from blender for agk tell me exactly what steps they follow to get an obj that works? Do you have to map uvs and have a material and texture applied? what export settings do you use? Do you triangulate the mesh before exporting or do you let the exporter triangulate it for you?
wargasmic
17
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 23rd Mar 2013 18:26 Edited at: 25th Mar 2013 17:23
OK I figured out that you should export while in edit mode with just the vertices/faces selected that you would like to export and have selection only checked.

This seems to work for me, but the uvs seem broken. When I load the model into my game and give the object a texture (which is just a green texture with some red grid lines for testing) the object appears a solid green, suggesting the texture is applies but the uvs are small and just mapped to a green section of the texture.

Any idea whats going on here?

Edit: Figured this out too. I had to change the mapping from generated to UV Coordinates.
wargasmic
17
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 25th Mar 2013 17:24 Edited at: 25th Mar 2013 17:36
This is really bugging me now.

My models now show fine in lilpissywillys model/shader test app but I still can't see my models AT ALL in my tier 2 project.

Edit: Checking that the files exist....



...outputs "Texture exists" but not "Model exists"

But both files are there.
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 25th Mar 2013 19:14
File name case correct????

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
wargasmic
17
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 25th Mar 2013 21:41
Deary deary me.

I had created a shortcut to my media directory on the desktop and was putting my media in here. On manually visiting the directory path I discovered the files weren't there!

Login to post a reply

Server time is: 2024-05-07 10:17:33
Your offset time is: 2024-05-07 10:17:33