Wednesday, January 20, 2010

blender texturing for collada/away3d

so i have a little project where i want to make a simple 3d model of a chair and bring it into flash. one of the textures will be able to be swapped in and out.

in order to do this, i will export from blender into the collada format. in away3d, i will then import it with the Collada Loader class.

here's how the blender bit can be done:


1. unwrap your model. simply press U and select unwrap

2. swap to the image window (shift f10)

3. with the faces selected that you wish to texture, go to image > open

4. load your image in and move it around until happy.

5. export to collada, file > export > COLLADA 1.4

6. you may need to edit the collada file image paths to be relative to the swf

Labels: , , ,

Wednesday, January 6, 2010

strange php/doctype bug

i was just spending the last few hours making a simple php template to use for websites when i came across a real strange bug. my template basically echos out the code for the document head, body and footer and inserts custom html in the middle somewhere.

now whenever i echoed out the head section with any doctype in it and any linebreaks, it put a space as the first character in the document, even though the source code was perfect.

i tried all kinds of str_replace on various hidden characters, \n, \r\n, \t etc. but to no avail. in the end i resorted to fixing it with css. i could have just had the entire head section on one line, but it bugged me and i wanted my template to spit out nice neat code.

anyways, will have the template up soon for all to download and use...

Labels: , , ,