Texture query with Open GL

Dr. Spankenstein's icon

How do I get one texture to wrap itself once around an Open GL shape/object as opposed to drawing itself on every face?

For example if I have a camera inside a cube how could I stretch or wrap the image so it covered the entire inside faces of the cube without being repeated?

Also if I have a mov file of dimensions 640 480 with borders at the top and bottom how do I go about getting rid of the borders?

Many thanks from a Jitter newbie.

Rhys

Wesley Smith's icon

There are usedstrect, srcrect, and dstrect attributes for cropping a
video in jit.qt.movie. As for the texture question, images are placed
on geometry according to texture coordinates. You need to set texture
coordinates of vertices that correspond with how you want the image to
show on the surface of the geometry. For a cube, I would generate the
vertices and texture coordinates and send them to jit.gl.mesh if
jit.gl.gridshape @shape cube doesn't do what you want.

wes

On 2/19/07, Rhys Perkins wrote:
>
> How do I get one texture to wrap itself once around an Open GL shape/object as opposed to drawing itself on every face?
>
> For example if I have a camera inside a cube how could I stretch or wrap the image so it covered the entire inside faces of the cube without being repeated?
>
> Also if I have a mov file of dimensions 640 480 with borders at the top and bottom how do I go about getting rid of the borders?
>
> Many thanks from a Jitter newbie.
>
> Rhys
>

Dr. Spankenstein's icon

So does this mean I could sync the texture co-ordinates to direction of where the camera is pointing?

Wesley Smith's icon

You can. I'm not sure what you're trying to do. You could use the
tex_plane_s/tex_plane_t parameters to shift the texture around
depending on camera orientation.

wes

On 2/19/07, Rhys Perkins wrote:
>
> So does this mean I could sync the texture co-ordinates to direction of where the camera is pointing?
>

randall jones's icon

look at jit.gl.plato. It creates coordinates for "gift-wrapping"
textures around the five Platonic solids.

-Randy

On Feb 19, 2007, at 11:21 AM, Rhys Perkins wrote:

>
> How do I get one texture to wrap itself once around an Open GL
> shape/object as opposed to drawing itself on every face?
>
> For example if I have a camera inside a cube how could I stretch or
> wrap the image so it covered the entire inside faces of the cube
> without being repeated?
>
> Also if I have a mov file of dimensions 640 480 with borders at the
> top and bottom how do I go about getting rid of the borders?
>
> Many thanks from a Jitter newbie.
>
> Rhys
>

Dr. Spankenstein's icon

Heres an example of the problem I am having, I'll have a look at the Plato example too, thanks.

Max Patch
Copy patch and select New From Clipboard in Max.

It will prompt you to open a movie.

Thanks again.

Rhys

Dr. Spankenstein's icon

The Plato example does not cover looking from with inside a cube? I'm at a loss as to where to begin.

Wesley Smith's icon

jit.gl.plato does do cubes. It may not be the mapping you want though.

wes

On 2/19/07, Rhys Perkins wrote:
>
> The Plato example does not cover looking from with inside a cube? I'm at a loss as to where to begin.
>

Joshua Kit Clayton's icon

If the built in texture coordinates are not what you're looking for,
it sounds like you will want to familiarize yourself with OpenGL and
tying textures to vertices. Start with the OpenGL sketch tutorial and
then move on to some of the other online tutorials around the web oft
cited on this list.

Yet another approach is to make a model file (or find one online)
which has the texture coords you want, and use jit.gl.model.

-Joshua

randall jones's icon

Well, move yourself inside the cube.

-Randy

On Feb 19, 2007, at 1:34 PM, Rhys Perkins wrote:

>
> The Plato example does not cover looking from with inside a cube?
> I'm at a loss as to where to begin.
>