[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Binding a texture "*.bmp" to glutSolidCube?

Posted on 2004-03-23
5
Medium Priority
?
4,787 Views
Last Modified: 2016-11-24
Please somebody help me!

Is it possible to use textures on glutSolidCube/glutWireCube and glutSolidSphere/glutWireSphere?

Cheers Tony!
0
Comment
Question by:TonyTigerHearty
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 1

Accepted Solution

by:
sylwander earned 2000 total points
ID: 10687956
Yes, it's quite easy. Just use the following commands in your code:


glBindTexture( GL_TEXTURE_2D, textureNr );
glutSolidSphere( params );


I think that should do it. If I'm not mistaken glutSolidSphere generates it's own texture coordinates, distributing the texture over the sphere surface. If that doesn't work you can try using the gluSphere command instead (you will need to define a quadric):


glBindTexture( GL_TEXTURE_2D, textureNr );
gluSphere( quadric, ballRadius, 20, 20 );

0
 

Expert Comment

by:kfarhang
ID: 21407014
I had this same exact problem, none of the solutions i was finding online worked, but this chunk of code works like a charm:


glBindTexture(GL_TEXTURE_2D, texture2);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glutSolidSphere(1.0, 35.0, 35.0);

Open in new window

0
 

Expert Comment

by:rICHO LOU
ID: 41900928
FALSE ITSN´T WORKS
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question