Paint a cuboid's different sides with diff images

Blitz3D Forums/Blitz3D Beginners Area/Paint a cuboid's different sides with diff images

Blitzplotter(Posted 2009) [#1]
I have been attempting to paint a cuboid (a box shape) with different images on different sides with limited success. I made a box shape image in Wings, imported it to Ultimate Unwrap 3D (which I apprecaite probable has the power to apply images to individual sides - however its too powerful for me) then exported the box to a b3d file. I am loading the b3d box shape into b3d and attempting to apply different png files I have created within a paint application.

Can someone please tell me the method to pick individual sides of my cube and apply images to it..... I'm getting a feeling of deja vue but I haven't been coding for a while.

thanks in advance - once this is resolved I intend to make it a downloadable package which will contain the image file necessary to run this code, including the .b3d file - I'll also include the InnoSetup script containing the text necessary to create a downloadable package, someone might find that useful. (Innosetup is an excellent program that allows you to make installable applications....).



I appreciate this code won't run as I have not made the image files downloadable yet - I will once I have been able to pick the indivdual sides and apply the separate images.

Thanks in advance.....


puki(Posted 2009) [#2]
This may depend on your model - and how you designed each face and named them.

You can 'face=FindChild(entity,"face name")' - then texture each face.

If it is a pure, standard, square box - why not just adapt the skybox code from the castle demo (I think it is in the castle demo)?


Blitzplotter(Posted 2009) [#3]
thanks Puki - off to try the FindChild to texture each face. Will have a look at the castle demo as well for the skybox.


Ross C(Posted 2009) [#4]
Your box may be a single surface, if you created it in a modeller.

In ultimate unwrap, choose each face, with the polygon select tool or face select tool, and when it's selected, create a new group, and new it the appropriate side. Something simple as "top".

Do this for all 6 sides, and export as a .b3d. Load that into blitz as an animated mesh. Then findchild, or get child, based on the names you used in ultmate unwrap.


Blitzplotter(Posted 2009) [#5]
Thanks Ross for the Unwrap suggestion, this may seem pretty basic but I'm having problems with selecting the faces...

I'm just revisiting this tutorial:

http://www.unwrap3d.com/tutorial_begin.aspx

Just finished that tutorial, exported the nicely painted box as a b3d file, but when I load the b3d file int0 b3d there does not seem to be any colours mapped to it ?

Within the tutorial it does say that if you click on the item with the T next to it in the top right selector that you should now see the modified bitmap on the exppanded uv break down, it is not appearing on here for some reason. However I can see the bitmap has been applied to the image within the right hand pane of ultimate unwrap.

I am now managing to select the faces individually within Ultimate Unwrap however.... and now I have managed to individually name the faces....






Ross C(Posted 2009) [#6]
Can you mail me the box please?


Blitzplotter(Posted 2009) [#7]
Just resolved it, I wasn't exporting the texture from Ultimate Unwrap, and also was not loading the new texture into the B3d, new code, needs tidying but works:

Got to go and play with the kids, will post my resolution later if anyone else interestred - I'm also interested in trying to access the faces individually now that I created within UU3D using Pukis findface command. Got to go and smell the flowers for a bit - big thankyou to Ross and Puki!




Ross C(Posted 2009) [#8]
Well in UU, make each cube side into a group. Then exort as an animated mesh. Then FindChild, using the group names.


Blitzplotter(Posted 2009) [#9]
Thanks for the extra tip Ross, I did not make it an animated mesh within UU before exporting it. Only saved it as the default file type (well with the b3d extension) before exporting the 'animated' mesh. I suppose if it is not exported as an animated mesh then B3D may have a problem with findchild using the group names - yep - it says in the B3D command refewrence it needs to be loaded as an animmesh to exploit the child entitys, i.e. faces.


Cannot find the option within UU to export as animated mesh - am now updating my UU3d - I was at 2.29, just downloaded 2.48

Hmm, I've been looking at CreateTexture and Loadanimtexture within the command reference - my head hurts - trying to suss what flags I need to populate after the filename to load my box with the associated texture.


Blitzplotter(Posted 2009) [#10]
Resolved here:

http://www.blitzbasic.com/Community/posts.php?topic=83190