Adding shapes to sphere
Hi again!
I would like to add a shape to my nicely rendered sphere, say a square. But I'd like the square to follow the curvature of the sphere, like I'm attaching a sticker to a ball. Is there any way to do this?
thanks
What u want 2 do is rather simple...
here is some pseudo
glLoadIdentity();
glTranslatef(0,0,-5);
// Now Render Sphere at position 1,2,2
glTranslatef(1,2,2);
glRenderSphere(Radius = 1);
// Now Render Quad at Position 1,1,0 relative to sphere
glTranslatef(1,1,0);
glRectangle(1,1,1,1);
I think u should check into matrices to understand more about the rotations and translations done consecutively
here is some pseudo
glLoadIdentity();
glTranslatef(0,0,-5);
// Now Render Sphere at position 1,2,2
glTranslatef(1,2,2);
glRenderSphere(Radius = 1);
// Now Render Quad at Position 1,1,0 relative to sphere
glTranslatef(1,1,0);
glRectangle(1,1,1,1);
I think u should check into matrices to understand more about the rotations and translations done consecutively
----------------------------http://djoubert.co.uk
I think he's asking about rendering the square as a decal. This is rather more complex than just rendering it in front of the sphere. :)
Orin Tresnjak | Graphics ProgrammerBethesda Game StudiosStandard Disclaimer: My posts represent my opinions and not those of Bethesda/Zenimax, etc.
You could make the sphere in a 3d modeling software and then cut out the decal shape, fix a nice set of uv coordinates or apply a new surface to that area.
And when you then load it into you program you get an nice well shaped decal shape.
I can not tell you wich one of these methods mentioned in this thread you should choose, because it depends on what you are going to use it for.
And when you then load it into you program you get an nice well shaped decal shape.
I can not tell you wich one of these methods mentioned in this thread you should choose, because it depends on what you are going to use it for.
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
Ok I'll try that, thanks :)
Basically, here's what I'm trying to replicate but in a 3D mode with lighting. Though currently I'm having troubles adding shapes to my sphere, particularly I cant overlap a sphere with another sphere, it ends up showing the bigger sphere only...
http://s24.yousendit.com/d.aspx?id=1PP2FFNBU0A0T3B2SANZDFW1JP
EDIT:
I see...probably since it's 3D, the sphere with the larger volume covers the sphere with the much lesser volume,I'll try solving this by translating the smaller sphere in the Z axis
Basically, here's what I'm trying to replicate but in a 3D mode with lighting. Though currently I'm having troubles adding shapes to my sphere, particularly I cant overlap a sphere with another sphere, it ends up showing the bigger sphere only...
http://s24.yousendit.com/d.aspx?id=1PP2FFNBU0A0T3B2SANZDFW1JP
EDIT:
I see...probably since it's 3D, the sphere with the larger volume covers the sphere with the much lesser volume,I'll try solving this by translating the smaller sphere in the Z axis
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement