[Radiance-general] OBJ2MESH - Phong smooth shading and texture mapping

Nicolas Roy nicolas.roy at VELUX.com
Wed Feb 15 15:58:47 CET 2006


Hi,

Thanks for the valuable information. I'm using Lightwave for modelling and
after inspecting the .obj file I used I can see that I'm missing the
information for vertex normal and UV-coordinates. I get the folowing out of
my .obj exports :


#     OBJ File Generated by LightWave3D
#     LightWave3D OBJ Export v2.2
#     Object: 1
#                     Vertices: 32
#                       Points: 0
#                        Lines: 0
#                        Faces: 36
#                    Materials: 1


o 1

#                  Vertex list

v 1.5 1.5 0.7
v 1.65 1.5 0.740192
v 1.575 1.6299 0.740192
v 1.425 1.6299 0.740192
v 1.35 1.5 0.740192
v 1.425 1.3701 0.740192
v 1.575 1.3701 0.740192
v 1.75981 1.5 0.85
v 1.6299 1.725 0.85
v 1.3701 1.725 0.85
v 1.24019 1.5 0.85
v 1.3701 1.275 0.85
v 1.6299 1.275 0.85
v 1.8 1.5 1
v 1.65 1.75981 1
v 1.35 1.75981 1
v 1.2 1.5 1
v 1.35 1.24019 1
v 1.65 1.24019 1
v 1.75981 1.5 1.15
v 1.6299 1.725 1.15
v 1.3701 1.725 1.15
v 1.24019 1.5 1.15
v 1.3701 1.275 1.15
v 1.6299 1.275 1.15
v 1.65 1.5 1.25981
v 1.575 1.6299 1.25981
v 1.425 1.6299 1.25981
v 1.35 1.5 1.25981
v 1.425 1.3701 1.25981
v 1.575 1.3701 1.25981
v 1.5 1.5 1.3

#         Point/Line/Face list

usemtl Default
f 3 2 1
f 4 3 1
f 5 4 1
f 6 5 1
f 7 6 1
f 2 7 1
f 3 9 8 2
f 10 9 3 4
f 11 10 4 5
f 12 11 5 6
f 13 12 6 7
f 2 8 13 7
f 9 15 14 8
f 16 15 9 10
f 17 16 10 11
f 18 17 11 12
f 19 18 12 13
f 8 14 19 13
f 15 21 20 14
f 22 21 15 16
f 23 22 16 17
f 24 23 17 18
f 25 24 18 19
f 14 20 25 19
f 21 27 26 20
f 28 27 21 22
f 29 28 22 23
f 30 29 23 24
f 31 30 24 25
f 20 26 31 25
f 27 32 26
f 28 32 27
f 32 28 29
f 32 29 30
f 31 32 30
f 26 32 31

#                  End of file

I will now investigate on a new obj exporter.

@                             nicolas.roy at VELUX.com
www                        www.VELUX.com


                                                                                                                                       
                 Ian Tester                                                                                                            
                 <ian at testers.homelinux.net>                                                                                           
                                              To                                                                                       
                 Sent by:                             radiance-general at radiance-online.org                                             
                 radiance-general-bounces at rad cc                                                                                       
                 iance-online.org                                                                                                      
                                              Subject                                                                                  
                                                      Re: [Radiance-general] OBJ2MESH - Phong smooth shading and texture  mapping      
                 15-02-2006 15:44                                                                                                      
                 Please respond to                                                                                                     
                 Radiance general discussion                                                                                           
                 <radiance-general at radiance-o                                                                                          
                 nline.org>                                                                                                            
                 Stationery name:                                                                                                      
                 -Untitled-                                                                                                            
                                                                                                                                       




On Wed, 15 Feb 2006 13:57:52 +0100
Thomas Bleicher <tbleicher at arcor.de> wrote:

             [snip]

> To check UV-coordinates check the lines starting with "f ".
> The three or four sets of numbers have the form
>
> <vertex index>/<uv-coord>/<vertex normal>
>
> If no uv-coord is present the field will be empty (like "1//1").

Almost. Sorry to nitpick, but all of the numbers in the face 'f' lines are
indexes. The preceding 'v' lines define vertex coordinates (x,y,z), the
'vt' lines defined texture coordinates (u,v), and 'vn' lines defined
normals (x,y,z).

e.g
v 0.485127 -1.896 1.33107
...
vt 4.03466 -0.392051
...
vn -0.0165774 -0.999061 0.0400231
...
f  352/1/1 358/2/1 364/3/1

All indexes start from 1. If there are no texture coordinates or a surface
normal for a face, those fields are left blank like you showed.

e.g
f 352// 358// 364//

Is this what you're seeing, Nicholas? If it is, you have to find a way to
produce a .obj file with this information. I can't be of much help
there. Otherwise obj2mesh and Radiance have nothing to work on. Then your
only option is to write your own functions for texture mapping and normal
smoothing.

bye

_______________________________________________
Radiance-general mailing list
Radiance-general at radiance-online.org
http://www.radiance-online.org/mailman/listinfo/radiance-general





More information about the Radiance-general mailing list