test font/back for planes

May 29, 2006 at 12:41pm

test font/back for planes

I’m rendering planes (jit.gl.gridshape) in jitter using sketch, and I want
to know if I’m looking at the front or the back of a plane. Therefor I guess
I need the planes normal vector and the eye vector. Are these available some
way using sketch/js?

I’d like to texture back and front differently, without rendering 2 textures
and 2 planes all the time.

-thijs

#26206
May 29, 2006 at 4:41pm

I believe you can do this with a shader and a multitextured plane. You
would do something like the following.

Vertex shader:

use gl_Normal to compare normal direction with the eye vector and
store in a varying variable

Fragment Shader:

use that varying variable to pick color either from Tex0 or Tex1 and
assign to the fragment color.

wes

#77955
May 29, 2006 at 6:43pm

thanks wes. i’ll go for the shader.

best,
-thijs

#77956

You must be logged in to reply to this topic.