Forums > Jitter + multiple textures using

February 11, 2008 | 3:41 pm

Hi all,

so, I have been playing around with and so far it has been great. Anyone have any ideas as to how i could iterate a series of textures on ‘n’

I have got the ListenerVecmath example to work with planes and the same texture over each but not so far as iterating different textures onto each planes.

Outside of lua i was using jit.matrixset to iterate textures on different planes but in lua i am not clear as to the best way to go about this

below is some of the code i have added to the ListenerVecmath example patch i am building from.

I guess the question is where to put the and and how to reference the relative textures.

Any help or directions where i can find more about this would be great!



objects = {}
objects.textures = {}

for i=1, num_objects do
objects.textures[i] ="", render_context)

for i=1, num_objects do
objects[i] ="", render_context)
objects[i].automatic = 0
objects[i].shape = "plane"
objects[i].position = {(i-1)/(num_objects-1)*6. – 3., 0., 0.}
objects[i].color = gray
objects[i].scale = {0.5, 0.5, 0.5}
objects[i].lighting_enable = 1
objects[i].texture = objects.textures[i]


function draw()
if(hitobj) then
hitobj.position = handle.position
hitobj.rotate = handle.rotate

for i in ipairs(objects) do, 0)
objects[i]:draw(), 0)


Viewing 1 post (of 1 total)

Forums > Jitter