--
Nicolas Garcia Belmonte - http://philogb.github.com/
Essentially what I am doing is building a fancy panorama viewer, but
texturing the interiors of cylinders with panoramic photos. I also
removed the caps on the tops and bottoms of the cylinder. So the
interior does have a texture (I didn't think it did before because of
another error I was having.) Unfortunately its horizontally flipped,
like looking in a mirror. I tried flipping the normals by multiplying
by -1 but that didn't seem to do it (also, I am not going to be using
lighting, although I tried it but it didn't work). Thoughts? Also when
its done I'll post the example, it has some good uses of picking and
other cool stuff....its just backwards!
--Ashley
On Oct 4, 2:47 pm, Nicolas Garcia Belmonte <phil...@gmail.com> wrote:
> Hey, sorry for not getting back quickly, I happy you fixed your issue!
>
--
newCyl = new PhiloGL.O3D.Cylinder({
pickable: false,
nradial: 30,
nvertical: 30,
radius: 3.5,
height: 3.5,
topCap: false,
bottomCap: false,
textures: (id+1)+'.png',
uniforms: {
useReflection: false,
alpha: 1
}
});
//texCoords flip
for(var i = 0; i < newCyl.texCoords.length; i++){
if(i % 2 == 0)
newCyl.texCoords[i] *= -1;
}
//normals flip
for(var i = 0; i < newCyl.normals.length; i++){
newCyl.normals[i] *= -1;
}
Normals Flip makes it brighter on the inside of the cylinder, but does
not reverse the texture. Flipping the X texCoordinates does the
trick.
Here are my texture parameters:
parameters: [{
name: 'TEXTURE_MAG_FILTER',
value: 'LINEAR'
}, {
name: 'TEXTURE_MIN_FILTER',
value: 'LINEAR_MIPMAP_NEAREST',
generateMipmap: true
}]