ARToolKit | Mailing List Archive |
![]() |
From: | "Fabian Scheer" <fabian@r .................> | Received: | Feb 3, 2005 |
To | <artoolkit@h ..................> | ||
Subject: | texture problem with VRML objects | ||
Hi, i got a little problem with a texture that i want to map to a VRML object. I want to do some sphere mapping on the VRML object. The texture coordinates a generated automatically by OpenGL through glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP) glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP) When i draw a glutSolidTeapot everything works fine. But when i draw a VRML object nothing is done. So are the normals of the VRML object loaded? Or is there any glDisable(GL_TEXTURE_2D) in this process? I couldnt find any in the library that would cause this problem. Another Problem is that the teapot that is drawn, doesnt look the right way. The bottom of the teapot is drawn over the side faces. I mention that this comes because of the projection matrix, cause there are some values which normally are negative, but are positive and vice versa. I think this comes because the y coords under Windows are flipped? But i dont know if i am right in that. I would be very thankful if anyone could help me with the 2 Problems ;) Fabian -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.4 - Release Date: 01.02.2005 |
From: | "Leach, Matthew" <M.Leach@n ...........> | Received: | Feb 3, 2005 |
To | "Fabian Scheer" <fabian@r .................> | ||
Subject: | RE: texture problem with VRML objects | ||
Fabian, If you are drawing the VRML through the openVRML libraries then I imagine that setting a texture would have no effect. When the VRML render functions are called, they load the texture/material that is described in the VRML file itself. You will need to add the texture in the VRML, either by hand or through a modelling program like 3D Studio Max. Which Teapot is drawn inside out? If it's the glutSolidTeapot then I have no idea, but if it is a VRML model that you've loaded it could just be a problem exporting from the package that you used (it seems the normals are flipped). Try loading the model in a browser and see if it looks the same. To the ARToolkit community: If anything mentioned above is wrong then please correct me. Matthew -----Original Message----- From: owner-artoolkit@h .................. [mailto:owner-artoolkit@h ..................] On Behalf Of Fabian Scheer Sent: 03 February 2005 00:28 To: artoolkit@h .................. Subject: texture problem with VRML objects Hi, i got a little problem with a texture that i want to map to a VRML object. I want to do some sphere mapping on the VRML object. The texture coordinates a generated automatically by OpenGL through glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP) glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP) When i draw a glutSolidTeapot everything works fine. But when i draw a VRML object nothing is done. So are the normals of the VRML object loaded? Or is there any glDisable(GL_TEXTURE_2D) in this process? I couldnt find any in the library that would cause this problem. Another Problem is that the teapot that is drawn, doesnt look the right way. The bottom of the teapot is drawn over the side faces. I mention that this comes because of the projection matrix, cause there are some values which normally are negative, but are positive and vice versa. I think this comes because the y coords under Windows are flipped? But i dont know if i am right in that. I would be very thankful if anyone could help me with the 2 Problems ;) Fabian --=20 No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.4 - Release Date: 01.02.2005 |
From: | Peter Oost <h.b.oost@s .................> | Received: | Feb 3, 2005 |
To | "Leach, Matthew" <M.Leach@n ...........> | ||
Subject: | RE: texture problem with VRML objects | ||
> > Another Problem is that the teapot that is drawn, doesnt look the > > right way. > > The bottom of the teapot is drawn over the side faces. I mention that > > this > > comes because of the projection matrix, cause there are some values > > which > > normally are negative, but are positive and vice versa. > > I think this comes because the y coords under Windows are flipped? But i > > dont know if i am right in that. On Thu, 2005-02-03 at 09:52 +0000, Leach, Matthew wrote: > Which Teapot is drawn inside out? If it's the glutSolidTeapot then I > have no idea, but if it is a VRML model that you've loaded it could just > be a problem exporting from the package that you used (it seems the > normals are flipped). Try loading the model in a browser and see if it > looks the same. Try using either of these: glFrontFace(GL_CW); glFrontFace(GL_CCW); This sets what opengl considers to be the front and backside of the polygon (determined by the clockwise, or counter-clockwise drawing order of the vertices). GL_CCW is the default value, so you'll probably need to set GL_CW when you render the reversed object and reset GL_CCW when you're done with it. -Peter |