About Store Forum Documentation Contact



Post Reply 
Artifact when rendering a ball mesh
Author Message
jordicat Offline
Member

Post: #1
Artifact when rendering a ball mesh
Hi!!,
I have a textured ball and it has an artifact when it is rendered in the screen (see the images, there is a vertical artifact in each image). Below the image there is the code. I don't know how to correct this, I have tried with many ways (welding vertices,...), but with no result, and only happens if I create the mesh with a Ball structure[/code].
I suppose the reason is that "Bola.parts.New().base.create" creates the ball with some bad vertices.
Any suggestions?
Thanks.
   

the code is:
[code] img.Import(str, -1, IMAGE_2D); // image .gfx created with editor

//--- Crear malla esfera ------------------------------------------------
Mtrl.reset(); // setup defaults
Mtrl.base_0.require(str); // set diffuse texture to white
Mtrl.base_1.require("../data/Emoticon/emoticon5.n.gfx" ); // set normal texture
Mtrl.color.set(0.7f,0.7f,0.7f,0); // set color
Mtrl.ambient.set(0.3f,0.3f,0.3f); // set color
Mtrl.specular=0.5f ; // set specular
Mtrl.glow=0;
Mtrl.bump =0.05f; // set bump value
Mtrl.rough =0.5f; // set roughness
Mtrl.validate(); // validate changes
Bola.parts.New().base.create(Ball(0.5),VTX_TEX0|VTX_NRM|VTX_TNG, 12); // 1 MeshBase, auto. tex. coord., normals and tangents
Bola.parts(0).base.texMap(Tube(0.5,0.5*1.2));
Bola.setMaterial(&Mtrl).setRender().setBox(); // set mesh rendering version and bounding box
06-19-2011 07:49 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #2
RE: Artifact when rendering a ball mesh
Shouldn't you be using a Ball for texMap instead of a Tube?
06-20-2011 08:33 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: Artifact when rendering a ball mesh
texture the ball in 3ds max and import it
06-20-2011 12:42 PM
Find all posts by this user Quote this message in a reply
jordicat Offline
Member

Post: #4
RE: Artifact when rendering a ball mesh
I used a Tube texture mapping because it takes just a rectangular texture and it appears in the ball exacly how I want.
Esenthel, the only way to NOT have artifacts in the ball is to do the ball and texture it in 3ds max? I wanted to do all inside the code and/or Material Editor. Because in Material Editor the ball HAS NOT artifacts.
Thanks.
06-22-2011 09:17 AM
Find all posts by this user Quote this message in a reply
Post Reply