View Full Version : New texture map plugin
Dennis
24th October 2003, 05:52 PM
Hi all,
I've written (with Andy's help) a "planar texture coordinates" plugin for AC3D. You can find it here (http://bellsouthpwp.net/a/t/atomicd/plantex.zip) (http://bellsouthpwp.net/a/t/atomicd/plantex.zip).
( warning - I believe this only works on AC3D version 4 )
This plugin allows AC3D to set global texture coordinates for your textured polygons (this is the way a lot of 3D game editors map their textures, and I'm using AC3D as a 3D game editor). It's two biggest features are 1) it prevents stretching on your textures and 2) you can use it on adjacent objects with the same texture to allow them to appear contiguous. I've posted screenshots below.
You can use this to rotate/offset/scale your textures on a per-surface basis as well.
The only downside is AC3D doesn't "remember" these settings per-surface. So if you resize/move your polys and need them re-aligned, you simply re-run the plugin on them.
Here's the interface:
http://bellsouthpwp.net/a/t/atomicd/iface.jpg
Here's a screenshot of textured polys using the plugin (this doesn't show off the rotation):
http://bellsouthpwp.net/a/t/atomicd/after.jpg
and here's a screenshot of the same scene w/default texture mapping (so you can see what it's really mapping against):
http://bellsouthpwp.net/a/t/atomicd/before.jpg
Hope you find this useful - please let me know if you run into any problems using it or you see anything screwy with it (again, I think it only works on AC3D ver4).
Thanks,
Dennis
[/img]
-WOODY-
27th October 2003, 11:46 AM
Ok I'll give that a shot. Normally after I texture an object I'll have to then re-texture the sides and top surfaces so as not to have any stretching.
Dennis
27th October 2003, 01:36 PM
Thanks Woody - I'd appreciate any feedback you can offer, especially if you find something that a) doesn't work the way you think it should, or b) you see a more intuitive way to specify options. And, of course, if you see any problems...
LiveWire
11th January 2004, 04:31 PM
sweet Tool! Extremly usful for modeling levels in games.
thanx!
Philip
Dennis
11th January 2004, 07:25 PM
Thanks LiveWire - I actually made an addition that allows you to map a texture nxn times across each selected surface. For example, take this fence texture:
http://bellsouthpwp.net/a/t/atomicd/fittex0.jpg
Using the default settings, the above surfaces don't map right when you have a 1x(n) texture, and it's a pain to get it adjusted manually. Using the "Fit" addition:
http://bellsouthpwp.net/a/t/atomicd/fittex1.jpg
fixes this.
I haven't tested it much, it's not intuitive control-wise (separate action button), and it's really best used on axis-aligned surfaces, so I haven't released it yet, but let me know if you want to mess this version.
LiveWire
11th January 2004, 07:44 PM
nice. that addition of fitting textures will be great, where do i download the newest plugin?
Dennis
11th January 2004, 11:38 PM
where do i download the newest plugin?
You can find it at http://bellsouthpwp.net/a/t/atomicd/plantex_beta.zip
Let me know if you see any problems with it. If you do see anything buggy/weird with it, if you can reproduce it in a *.ac file and send it along, that would be great.
Enjoy!
-WOODY-
12th January 2004, 09:13 AM
Well so far since I've been using it, it's been working perfectly. Before you came out with that "fit" function, I would just normally use the scale and offset functions to fit the texture to a single surface.
I'm sure this added function will make this much easier.
figgy
24th January 2004, 05:52 AM
Great work Dennis. :D
Mark
LiveWire
25th January 2004, 05:30 PM
Im having problems with the Offset function, basicaly nothing happens to the textures when i change the offset value.
any help
thanx
Dennis
25th January 2004, 11:59 PM
Im having problems with the Offset function, basicaly nothing happens to the textures when i change the offset value.
any help
thanx
When you change the offset value, are you hitting "Apply" (or "Fit" if you're doing a texture-fit with the beta version)?
Also, make sure you're using a value greater than -1.0 and less than 1.0. "Offset"is a percentage field, so specifying a 1 will shift the texture 100%, so you won't see any apparent change using a whole number. So, an offset of 0.5 will shift the texture by half the texture's X/Y size.
Let me know if that works.
Dennis
LiveWire
26th January 2004, 02:57 AM
i was ofsetting it by like 50 and nothing happend, i figured it out thou
thanx
Dennis
26th January 2004, 07:05 AM
i was ofsetting it by like 50 and nothing happend, i figured it out thou
Excellent. I updated the plugin to change the hint text when you mouse-over the fields - hopefully that'll make it clearer. Get it at http://bellsouthpwp.net/a/t/atomicd/plantex_beta.zip (only the TCL file was changed).
I can absolutely see where you might input a "50" to offset a texture by 50 pixels (that does seem more intuitive).
However, using percentages, you don't have to remember the pixel height/width of each texture to offset it by, say, 50% - another advantage to percentages is you can alter the offsets on multiple surfaces with different-sized textures and they'll all shift the same relative amount.
Hope that helps.
Dennis
LiveWire
27th January 2004, 11:21 PM
yes it makes sense to offset it by percentages, but what if you made it so that you set it 50 rather than 0.5 to offset it by 50%
that would make it a lot easyer for people first using the plugin to understand.
50 / 100 = 0.5 :wink:
just a thought
Philip
Dennis
28th January 2004, 01:12 AM
yes it makes sense to offset it by percentages, but what if you made it so that you set it 50 rather than 0.5 to offset it by 50%
Ok - try this: http://bellsouthpwp.net/a/t/atomicd/plantex_beta2.zip
I actually do like it better with "whole number" percentages. Now scale and offset all interpret 50 as 50% instead of 5000%. You can still use decimal places on these fields (i.e., 15.298% is a valid scale/offset).
As always, let me know if you see any problems.
Dennis
LiveWire
28th January 2004, 06:54 AM
wow, thanx!
by the way, just for a touch up, you could make it so there where only one close boxes insted of two.
great plugin, im my opinion, youve made one of the most usful plugins of them all, you should realy talk to andy about adding it to the downloadble plugin pack on ac3d download page(and mabey even getting him to make it part of ac3d itself! just a thought)
ive been useing it quit a bit latly and havent come along any bugs
Philip
Dennis
28th January 2004, 05:36 PM
by the way, just for a touch up, you could make it so there where only one close boxes insted of two.
Consider it "touched-up"... http://bellsouthpwp.net/a/t/atomicd/plantex_beta2.zip
great plugin, im my opinion, youve made one of the most usful plugins of them all, you should realy talk to andy about adding it to the downloadble plugin pack on ac3d download page(and mabey even getting him to make it part of ac3d itself! just a thought)
Thanks! It's really an invaluable plugin if you're using AC3D for level editing (I'm using AC3D as a level editor for my own game project/hobby).
Andy: you're more than welcome to add this to the plugin pack - I've used it quite a bit myself, and haven't run across any problems. I've posted the source for you (or anyone that's interested in it) at http://bellsouthpwp.net/a/t/atomicd/plantex.cpp (the latest TCL is in the plantex_beta2.zip download). The source comments have not been updated with "fit" documentation, but the logic's there.
Anyone may do with the source as he/she sees fit.
LiveWire
28th January 2004, 09:34 PM
sure, i think ill take a look at that source code(havnt made any plugins myself, would probly teach me somthing :) )
as always, love the plugin, makes life easyer :wink:
also...
to WOODY: The BluePrint & Textures Links on your fan site are awsome, ive been looking for good textures, just like to say thanx.
Philip
Colossus
16th March 2004, 03:20 AM
Hi Dennis,
would be possible to release a Linux version of the plugin please ?
Thank you,
Colossus
Dennis
16th March 2004, 10:24 AM
would be possible to release a Linux version of the plugin please ?
I would like to, but don't have a Linux OS installed on which to compile it.
I have no problem releasing the source ( http://bellsouthpwp.net/a/t/atomicd/plantex.cpp ), so anyone that wishes to compile it under Linux is absolutely free to do so...
Colossus
17th March 2004, 05:59 AM
I need the file ac_plugin.h to compile, may I have it please ?
Colossus
Andy
17th March 2004, 06:08 AM
No prob - see email.
Andy
Colossus
17th March 2004, 07:03 AM
Thank you Andy,
I was able to compile plantex.cpp for Linux through some hacks but when running ac3d I get:
failed to load plugin '/Stuff/ac3dlx/plugins/plantex.p'
error: /Stuff/ac3dlx/plugins/plantex.p: ELF file's phentsize not the expected size
What does it mean ? I compiled it with g++ -c plantex.cpp
Thank you,
Colossus
Colossus
17th March 2004, 07:24 AM
Ok, don't mind. I compiled it as a relocatable object instead of a shared one. I have it compiled and working. Anyone interested can get the Linux version of plantex at:
http://net.supereva.it/colossus.freemail/plantex.p
Regards,
Colossus
-WOODY-
17th March 2004, 09:57 AM
This plug-in also works good for curved or spherical surfaces. If you model a curved surface using quads and use a texture that has a large or simple pattern, just use the "Fit" option and it works great.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.