jit.gl.model with jit.gl.texture – looking ugly – help?
What is the best way to get an image to map onto a torus in jitter? None of the settings that I can find yield acceptable results. It’s very easy to do in Blender, UV-mapped and all. How does one create this effect using jit.gl.model or jit.gl.gridshape with jit.gl.texture? the repeat and etc options get all stretched and weird – lol – I wouldn’t mind a straight repeat/tile.
Also, I have a pretty hi-res image that I’m trying to use as the texture, and no matter what scaling settings I try, I seem to get a very degraded result in my jit.window.
Must be I’m missing a setting or two here both in mapping and scaling or positioning the image.
It would be great to know the correct approach for mapping and scaling an image onto a torus so that it looks reasonably high quality (as the source image does).
Thanks so much!!
hi, please post a patch showing what you’ve tried.
Thanks so much for responding. I'm attaching the maxpat here. I'm using a torus as the model (about 5 mb so I can't upload here) and a fairly hi-res jpg for the texture (also about 5mb )
The main question is what is the best way to get a nice clean map on the inside of the torus (trying for a tunnel effect). I need to be able to tile/repeat the texture (or something) and have it look like the attached jpg which is what it looks like in blender using a UV map – I wouldn't mind some stretching since I can't UV map in Max (or can I?), but currently the result doesn't look at all as nice as with the blender setup.
It gets splotchy probably due to attempting to "zoom" to size the texture on the model. I think it would work better to somehow resize, but i don't know how that is done.
Let me know if this is helpful info at all, and/or if you need anything else. Thanks!
p.s. I can send you the actual torus .obj and texture .jpg if you need to determine the problem. The image is just a large square with patterns on it.
if you have it looking how you like in blender, why not simply export a collada file from blender?
this should export whatever material you are using in blender, which should have the proper texture settings and mesh uv’s.
you can load collada files in jit.gl.model, and it should very close to the blender version.
I wasn’t aware of the Collada export/import ability – I’m somewhat new to the OpenGL aspects of Max other than simple videoplane functionality. This is my first set of patches using jit.gl.model . I’m digging in a lot further now and also got Max6 and Gen today =)
Thanks for such a quick response, and I’ll look into Blender–> Collada–> Max. It sounds like that would be perfect !
sounds good. let us know your results.
I exported the model with UV and Texture to Collada (.dae) file. It reads into Max but although the graphic I’m using as a texture appears much cleaner now, I don’t know how to get it to "tile" or repeat. Max doesn’t seem to support the UV mapping or the repeat mode from Blender/Collada.
I also don’t know what wrap modes are supported in Max6 for texture, or how to properly message the texture to try changing to mapping to see what might work. jit.gl.model now has the texture "inside" it.
I realized it would be helpful for you to see what it currently looks like =)
nice clean display of texture where it does sit on the torus, but not tiling, or repeating – seems to be ignoring the UV from Blender.
I’ve uploaded the .dae file and maxpat with its json file (read the .json after reading the model .dae file) to setup the position of the model and camera etc.)
So frustrating that I can’t seem to get anywhere still. Different path, but although some minor progress with texture image quality, no idea how to get a fully mapped torus that looks even about right.
I’m tryin’ – lol
can you also send the texture you’re using?
i can’t really test this out without it. you can compress it so it’s not so huge.
one possible issue is that certain wrap modes in opengl only work if the texture is non-rectangular (rectangle 0).
jit.gl.model *should* load the textures as non-rectangular if their dimensions are equal, and this *should* allow you to try all the wrap modes.
anyways, don’t get frustrated. learning this stuff takes time.
Here's the texture – I'd be so happy if you're able to come up with a solution, or something close to one – lol
you simply need to tell the internal texture "rectangle 0" so that you can use wrap mode repeat.
it’s a little tricky.
i’ve modified your patch slightly to show you how to do this. it uses the model’s "read" notification to send a bang when the model has finished loading the file.
jit.gl.model names all it’s internal textures based on it’s @name attribute, so you want to explicitly set that to something so it’s not randomly generated each time the patch loads.
i’ve also added a jit.anim.drive object to animate the turning.
you want your qmetro to bang at a faster rate in order to get smooth animation. the drawing is synced to the window refresh rate by default, so you want the metro to bang faster than the refresh rate.
let me know if you have more questions.
----------begin_max5_patcher---------- 2911.3oc6cssbahjF9Z4mBJW6kdT0Ggl4pr0t6yvdwTtbgjZKSBFzBH6jYp4 ce6Sf.IQSiBfODkIikoaA7++8etOk+5lE2tJ667ha89cu+vawh+5lEKTMIaX g45E29bz2WmDUn9Z2tN64m4ok2dmtuR92K0smDu9adkOEW3Ul4UtOOUbAW76 46Kp9x6hJW+Tb51Gx4qK0uzvvvkf67PDf5C.U8gnMu6M2T7F0yOa0W+MXX0S 5wrzxznm4pt9m4wQIU8jt+43zDdohZgGZLaeYUqfFOjh3+T8Pf9KqZd09UqR zMJa3uu4F4OtyQ74YdQQzV9I3iBQfd.OfMz.Aaf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bIh.weXFDPbf9nsUOPm9AJAAhYZZJXC+IvfnhMzivuwffPlFFf5 pbX.FDv.bS4PHS4XJ.MgxAhqrw.LHPPXC1.gX0WMEbfKQrHngYPH+WIH4f7q OphCoXkAADaZZJXCWBzgCGlAggMH5ittpJePSSHBBzUAw.rHBoAMEDLekEAK XBED.WYiAXQDpizYXCH.xpubJpa1EIAZ9R5F6BjhmuwZB4z3JLeCM3QS9wEF LbDomfIvWDSOjQDspekuH4USfE.xkvZpg3adJyCgckdlmx7PHWom4oLOnSkc NeyqBDMkzidJmOZYPKIkiV9yGszmOdYOKdZ+8M+e.MLGKhB -----------end_max5_patcher-----------
and here’s how you can do it with just standard jit.gl objects:
----------begin_max5_patcher---------- 1092.3oc0Y01ihpCE9y5uhF+rCgBTTtexj6+g68Ca1XpRGryBsrkxnyrY+uu 8EXzcVjWLtJFSZCkZ447bNOmdJ7ioSlsgefTLC7Ofu.lL4GSmLwLjdfIUWOY VF9v1TbgYZyxHEE3Dxr416IIGjlwEDbL3+woo43bh3eSIXFz4k7j4fMXVR8z ywxs6nrj0BxVo8w56563NW0oa8bCzcvHGWvWq9OzXyCfu4km7qWmm4LICmQL 24+HhXLCWeOVYFkkRjF75cbPdordT3IKSA8cyx.8TOY6v1YJeKmXg3rYe.lb AofvjXIkyN0Hpfejt0spA7U8+4mSmpal2S9kQ1qrz+fdegJcvLZlSrf9JArR VJX.WvSPfa8bSoLxVdISdpc2.gipv5RSGz0z4G1Li6ENXJG1Hk6MTJetg1u. FbSoTxYsEwEgzl7hpHt51FMez.LQ34rEiB3hrk1TasYgVWr0BQtsIo7tiZpq q736RmL9qTk3.WJ4ERrPpTHqvw3bI.1nJwuSJDBOUkfNWXB7NoRT185LrTPO b45kVnzjTmsJiQfaIVyqJ+wo7jGrYdBFdG4ojz0ZiqTPp3p50PvemvVqvmxl VikJ1TkBwtq3jO3LksyKn5z91kzXmOYMZGWT8poBv37ugq3FnSD5y6GXcOWW mTkcAVocKpjMoDcj+dANGHH4DrDrRS1fr2TyrQkPP2JgkKMc1qBQmwCiFSd3 qNQmHnwE6TU3.VY6jbQYg5hLNWtasZrXE4AfJOAWUj.4vauChbA5eqpcRFm. X0VdJWnlo4Wi9jvN8I9AlZmf1T7QAmI6zXI4z.EbBb7ZEn3B8Mbc7tb0ijmn zDsVDpl.CNoRT+yjpO53pHTTojHVSX3MoFi18JTr.U67uhQtRvFfJCdQ2le0 dcgAskBewcJXxdJBvLqobMInuq7hBN.0I+XKXNLrM5I7NUM0kWhYKI71SYw7 8fUOWfwGyQcV9wqpVIOTaLTvcN.5uw1BBBKlH5Vfg5UQROjDjNMdIsaJXYen fdUDg9IZF+4Tt573GeICZuy58zX4NytnKctfzx+cOESmjU0oRqOhZ6wKKFDa UUeZibEZwCHWEVsecnipVauf14pkChq9nj+GNRA86xMTqrhm6vhfnI6z5s5B edTIm58q5fbFl75XQqObzR.5zx.6Hqi2vTRYz7Lb9iKm3G0mPknAwIXFsfqJ 8L+sGWIDpORH+gkeoHmPhuYThAvlCd+ouChwp0i+67TAuTrsdop9nDfilcLo PkaDe7EE8wKH7jIsiFGSXmdhwXZgNWpgybazg0W3f5AbBtYnIrGnYwMCM5mD rCz.uonwczflndflvaFZf8hbtg3Y43BOeJgxYvC51gmQVVPOzHCOt8AO2N3D NtfyhwEbVNxDWQiK732qf4KMYnsfLbd9qDQQ0ZZfhpD0WreL.yWFY1wuMf4R A4UZ87QS0q1Om9KvkaVRi -----------end_max5_patcher-----------
Hi Robert – Right in a recording session now, but I had to check, and voila – you have responded – Thank you so so much, and I will let you know how it goes when I get a chance to check it all out later.
This is awesome !
I had to check – stopped the session – PERFECT!! Thank you so much again for your time and expertise.
I’m going to hook this up using OSC from my iPhone to control it.
Back to other work – lol
I have it hooked up to TouchOSC now, controlling the ride thru the tunnel using my iPhone now – Sooo cool.
Thanks again , Robert!
Forums > Jitter