Mapping textures to curved OBJ model
My understanding of 3D is tenuous at best, so I’m hoping there’s something obvious I’m missing here… I’m trying to map a texture to a curved segment (imagine one of the pieces of a dome tent), but as I move it across the model, the top-right corner appears to distort differently to the rest of the texture. My modelling skills are equally limited, to I’ve attached the file here in case that’s where the problem lies.
I’ve also noticed that I’m not able to use the same texture across several instances of [jit.gl.model]. I’m not sure if that’s by design, or I haven’t got it set up correctly?
…not sure what’s going on with the forums, but I’m having trouble including compressed code and attachments. Try here: https://drive.google.com/file/d/0B1XKsPru17NJM25XZ01aQVRaVkU/edit?usp=sharing
You have two issues in your patch:
1. I tried to have a look at your obj-file, but blender is unable to load it. so I have to guess, but it looks as if you uv-mapping is doing that. this has to be set when you are modelling your object.
2. each jit.gl object has to be set to a render-context, personally I always set it manually and dont let jitter do the trick. in your case you have three context’s, but you didnt specify the context for your texture, which means that jitter just thinks it belongs to the first one. since each texture can only belong to one context you can now do two things:
either add another two textures for each context, or set the @shared attributes of each of your pwindows.
Thanks, Maybites for your reply. Setting @shared on the pwindows did the trick getting the one texture into each context.
I created the 3D object in SketchUp, which might be a problem in itself. I downloaded a copy of Blender, but can’t open the OBJ file either. I tried adding a material in SketchUp and everything looks okay to me (not skewed; see screenshot), but maybe uv-mapping isn’t exporting correctly along with the OBJ file?
I dont know sketchup well enough to help you there. I had a look at th obj file and it looks a bit messy (compared what blender exports), but then: jit.gl.model can read it. I would do it in blender, but if you have not any experience with it, a steep learning curve waits for you :-/
Yep, it certainly is a mess: got it into Blender as a Collada file and when translating, the model skews in the same way that the texture was in Max.
I managed to wrangle a very basic shape out of Blender. It looks better, but when using the new OBJ file in Max, the texture appears at a really low resolution (maybe 2 x 3).
your object has no uv-mapping. inside blender select the object, go into editmode and choose the scene layout UV-mapping, then press U (with your mousepointer inside the 3d window) and select one of the possible UV-mapping algorithms.
I use many models from blender that are then imported into jitter.
Export as Collada and make sure that the UV layout data is exported as well (specify this in blender). It can take a while to get the right export settings but once you’ve got them then you can save the export settings for future use.
You can apply modifiers to make very simple curves and other deformations and then select "export with modifiers" this way you still keep the raw model and can come back and tweak them as you see fit. :)
To make that model in blender is very simple, add a plane, grab two corner vertexes and just move them closer to each other on the X axis. Then use the mesh editing tools to gently curve it from the middle.
Thanks so much to you both for your advice – it’s looking a bit better after putting in UVs. I think I’m going to have to spend some quality time getting to know Blender…