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.

Newcomers AppGameKit Corner / How do I import OBJ with color?

Author
Message
itsanewme80
7
Years of Service
User Offline
Joined: 21st Aug 2016
Location:
Posted: 21st Aug 2016 22:02 Edited at: 22nd Aug 2016 02:48
I created a six-sided die in Blender and added texture to make the body white and the dots black. I have unwrapped the object, exported the layout, colored the layout in Gimp, and reimported the layout in the UV mapping window. Everything lines up and I can see the white and black colorations in render view, material view, and solid view. When I change to texture view, I can see the white but the black looks faded, so I'm not sure this is correct.

When I use LoadObject(1, "MyDieObject.obj") in AppGameKit, the object loads but it is just plain white/grey.... the dots do not show as black and the body does not show as white.

I have tried everything I know how to do and even a few YouTube videos but haven't been able to get the die to import to AppGameKit in anything other than the default grey color.

Any suggestions would be MOST appreciated!!
itsanewme80
7
Years of Service
User Offline
Joined: 21st Aug 2016
Location:
Posted: 22nd Aug 2016 02:52
Grrr... I edited two words in my post and the whole thing disappeared.

Here we go again....I've created a six-sided die in Blender with texture to make the body white and the dots black. When I export it as OBJ and import it to AppGameKit, it appears as the default grey/white color. I have unwrapped the object, colored the texture in Gimp, UV mapped, etc. I can see the white/black coloring when I change the viewport to Render, Material, and Solid mode, although it does not show when I select Texture mode. Hmmmm.

Anyway, can anyone tell me what I'm missing here? Where does AppGameKit look to find color/texture information for OBJ files? ... or is my Blender object not built correctly?

Any help would be appreciated.
hoyoyo80
7
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 22nd Aug 2016 07:12
U need to texture it using commad. Load image and setobjimage something like that. Look at help file
itsanewme80
7
Years of Service
User Offline
Joined: 21st Aug 2016
Location:
Posted: 22nd Aug 2016 12:37
Sorry, hoyoyo80, that doesn't really help. Could you explain how to use SetObjectImage in this case? I have looked at the documentation built in to AppGameKit as well as the downloadable beginner's guide, but neither really addresses the issue I'm having.

Hoping someone can help......
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 22nd Aug 2016 13:32
You would load the object texture as an image, then apply this to the object, so the object is textured with the dice sides.

DiceImg=LoadImage("dice.png")
DiceObj=LoadObject("dice.obj")
SetObjectImage(DiceObj,DiceImg,0)

Something like that, don't have AppGameKit close by right now.
The code is dark and full of errors
itsanewme80
7
Years of Service
User Offline
Joined: 21st Aug 2016
Location:
Posted: 23rd Aug 2016 02:21
Van B - It worked perfectly!!! A thousand thanks!!

Login to post a reply

Server time is: 2024-04-25 06:01:15
Your offset time is: 2024-04-25 06:01:15