Buttons with models as images

Hi guys,

In this project I’m working on, I need to load an .egg model, and somehow place an image of the model on a button. Something like a thumbnail view of an object (which I can click on and make a copy of the object on a terrain, something like Build Mode in The Sims).

The objects will be loaded from a folder, and the program will load all models from that folder when it initializes. So far I’ve got the loading done, but I have no clue at all on how to convert the model into an image in runtime. Can anyone give a rough idea on how to do this, or point me to any references? Thanks.

Are you using a modeler like blender or maya? If so, you can simply render the model, and then save it or do a printscreen (depending on what you’re using). If you only have the egg, you can just do a printscreen of the model after it’s been rendered through panda. Otherwise, you can export the egg file into a format that is importable by your preffered rendering/modeling or w/e program.

If you choose to printscreen, all you have to do after you hit the button is paste it onto any paint program and then save.

Does that help? Or am I just thinking too simply?

the magical words are -> render to texture.

try this - first render automatical of all your models at your directory a screenshot by using a default alignment to the object or to the average normal direction of your model (please dont use a sphere or a complete closed body for average normal direction rendering)

second count your models, so now you know how many buttons you need. point the button to your model and thats it… that way i would go in such case like this just automatical procedere no need for handmade screenshots :slight_smile: i hope i was helping you a bit…

the 3th step save your model list and just render the new files…


Thanks for the replies guys.

kayn - I could do printscreening, but I was trying to think of a way to automate the whole process :stuck_out_tongue:

ditus - Do you mean this? Thanks for the info, I’ll try that out :slight_smile:

(Fake edit: While searching through the forum for render to texture I encountered ‘base.screenshot()’. Panda is getting cooler and cooler every time I discover something new!)

Yup, I think Panda can even record screencasts. (I’m not very sure about that though)