PDA

View Full Version : How to increase size of an Image



shivukumar
02-12-2010, 02:28 AM
Hi,

I created Cylinder(Using Primitives) and places four images on it surface.

My question is :
while rotating the cylinder,The image closer to the viewer looks in a bigger Size compared to other images side to it.

please Help me..

I am Thankful for your Answer.

Dark Photon
02-12-2010, 05:41 AM
You haven't clearly stated what you're doing, much less what your problem is. Post a little GLUT test program illustrating your problem.

DarkShadow44
02-12-2010, 01:30 PM
Isn't it normal that the image closer to the viewer is bigger ? :confused:

shivukumar
02-14-2010, 11:23 AM
Hi,

Thank you for replying.

No, The picture which is closer is not looking big one.

What i mean to say is, consider there are more images on the cylinder surface.
consider On the front face of the cylinder which is closer to the viewer as Three images.

I need to make the size bigger for image which is located at the center.

I hope you understood my question ?

Please help me from this ..


I am thankful for your reply ..

DarkShadow44
02-14-2010, 12:12 PM
How do you map your textures ?

Are the images among each other ?

shivukumar
02-15-2010, 04:11 AM
Hi,

Thank You for replying,

I didn't get what you asked ?

The below Link will show you the cylinder with images on the surface of it.
please check it.

http://img29.imageshack.us/i/untith.png/

There are three bird images are visible(on the front side). What i want to do is the image which is in the middle will look big one.

How to do it ?

Please help me from this..

I am thankful for your reply.

DarkShadow44
02-15-2010, 01:13 PM
Hi,
for what do you need that ?

Would it help to zoom on the cylinder ?
Therefore you should use

glMatrixMode(GL_MODELVIEW);
glTranslatef(0,0,x); // x bigger than 0, for example 3

Or should the cylinder remain as it is ?

Can the cylinder be rotated ?

You could map the image in the middle other...

I don't know how you map your Texture :eek:

shivukumar
02-15-2010, 09:52 PM
Hi,

Thank you for your idea,

I already used the above two lines in my code. but there is no change.

Yes the cylinder is rotating and the rotation is controlled by mouse button. by clicking the mouse button it will rotate around 10 degree.

The size of the cylinder Shouldn't vary, but the image which is closer to the viewer should be scaled to bigger image.

How it is possible to scale an image on the surface of the rotating Cylinder ?

Please Help me..

I am thankful for your reply.

dukey
02-16-2010, 04:00 AM
glMatrixMode(GL_TEXTURE);
glScalef(some,numbers,here);

DarkShadow44
02-16-2010, 09:59 AM
There MUST be a change with "glTranslatef()" :p

shivukumar
02-17-2010, 05:43 AM
Hi,

Thank you so much for your replies.

In my code i used "glTranslatef()" ,
But Translation allows you to move an object from one location to another within a 3D environment.

By using the above function how i will get the image with bigger size ?


and even i tried two lines of code which is in above post :

glMatrixMode(GL_TEXTURE);
glScalef(some,numbers,here);


After using this i am getting blank screen.

please Help me from this . .

I am Thankful for your reply.

DarkShadow44
02-20-2010, 03:13 PM
glMatrixMode(GL_TEXTURE);
glLoadIdentity(); //Very important

//Manipulating in Y-Axis
glScalef(1,x,1); //0 < x < 1 bigger texture
//x > 1 (for example 1.5) smaller texture

Hope that helps you ;)

shivukumar
02-21-2010, 10:23 PM
Hi,

Thank you so much for your reply,

After trying many times, i am not getting where exactly i have to place the above lines of code.

My code is MULTTEX (http://www.2shared.com/file/11573190/1b7fba6c/multtex.html)

The above code will places single texture(image) on the cylinder.

Here is the OUTPUT (http://img202.imageshack.us/img202/1701/unti.png)


Now i tried to place different images(Multitexture) on cylinder Surface.
Here is the code which i tried to do multitexturing
MULT (http://www.2shared.com/file/11573291/6e3e34a3/mult.html)

But this code showing segmentation fault and displaying only width and heigth of all the three images.
please help me to do multi-texturing.

I am kindly requesting you to solve my above problems.


I am thankful for the reply.

DarkShadow44
02-22-2010, 01:21 PM
You load you texture each frame ??? :eek:

LoadGLTextures(image1,0);shouldn't be in cylinder()...

Where exactly do you map your "middle" image ?

Sorry, but I don't understand your Modelview/Projection Settings :(

shivukumar
02-22-2010, 10:45 PM
Hi,

Thank you so much for replying,

The program(MULT) in above post is what i tried to do multi texturing in that i have not used LoadGLTextures(image1,0); in the cylinder function.

actually the cylinder is made up of polygons where the nvalue is 32. i am not mapped the image in the middle. i am trying to place different images in each consecutive polygons.

i dont know what i am trying is right or not ..

Please help me with snippet of code for doing multi texturing.


I am thankful for your reply.