PDA

View Full Version : How do I associate a texture file with an object?


Rick Kimball
19th May 2006, 06:33 PM
I'm updating my x3d_importer for AC3D version 6.0.
How do I go about loading a texture and associating
it with an object?

I was looking at add_new_texture_opt but I can't figure
out what arguments I'm supposed to pass.

Thanks,

-rick

Dennis
19th May 2006, 08:22 PM
Hi Rick,

90% sure of this - perhaps Andy can verify:

char *name = the full path to the texture
char *origname = a partial/relative or filename-only path? (not entirely sure on this, but having the correct filename in *name seems to load it...)

add_new_texture_opt() returns the texture ID of the newly loaded texture, which you should be able to assign to the object using object_texture_set().

Hope that's correct ;)

Rick Kimball
19th May 2006, 08:46 PM
Thanks Dennis!

That is exactly what I needed. I compiled a new version for AC3D6
for win32. (i'll get to the linux soon) You can find it here:

http://ac3d.kimballsoftware.com/

-rick