[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: .obj question




On 13-Jan-2000 Steve Baker wrote:
> Erik wrote:
>> 
>> Hi, sorry to pollute the list with this stupid question :)
>> 
>> is there any convention for differentiating between frontface and backface
>> in
>> wavefronts .obj model format if normals aren't provided? (I have a couple
>> models with only vert lists and face lists, and my viewer is drawing half
>> the
>> polygons with the wrong face). All the pertinant links I could find were
>> either
>> dead or didn't go into detail :/ Any help would be greatly appreciated,
>> thanks
>> :)
> 
> I have heard (although I have no personal experience with .obj) that this
> is indeed a *fatal* problem with the format.  There is no
> clockwise/anticlockwise
> ordering convention - and also no normals.  The renderer this format was
> intended to drive was a non-realtime raytracer kind of a thing - and
> backface culling was not an important feature.
> 

there is a vn flag which specifies a vertex normal, unfortunantly the models I
have are sans normals.

> There was a long debate about ways to possibly work around this on the
> OPENGL-GAMEDEV list maybe a year ago.
> 

which one? I was told to get on one for good convo and all they do is flame
everyone for being off topic (I'm not even sure what the topic is, but
apperantly it's not opengl and it's not gamedev even tho those words are in the
list name). opengl_gamedev_l is the one I see you talking in, so it's probly
that one :)

> There were various hare-brained schemes for presuming (or being told)
> that the 'object' you are loading is either a predominantly convex
> 'solid' thing (like a house-brick or a Thaaarg-Warrior) - or a predominantly
> concave 'hollow' thing like the inside of a room.
> 
> Armed with that prior information, the tool would walk around the connected
> polygons, and figure out what is 'inside' and what is 'outside'.  You can
> pick one polygon, and choose which direction it faces arbitarily.  Now, you
> look at each edge in turn, find a polygon that shares that edge and if
> necessary, flip it to point the way as the first one. Applying that algorithm
> everywhere produces an object that is either 100% correct - or 100%
> inside-out.
> It's a relatively simple matter to figure out which is which by counting the
> number of edges that are convex edges and the number that are concave - and
> ensuring that the majority of them are facing correctly.
> 
> Of course this fails completely if the object is not fully connected - or
> if it has single disconnected polygons and stuff like that.
> 
> Yuk!
> 
> I think the short answer is "don't do that".
> 

I think some of the polys I have are double-faced, to boot. Like the rudders
and canards. Durnit, wasted days for picking the wrong format :) Thanks for the
help

> -- 
> Steve Baker                  http://web2.airmail.net/sjbaker1
> sjbaker1@airmail.net (home)  http://www.woodsoup.org/~sbaker
> sjbaker@hti.com      (work)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: linuxgames-unsubscribe@sunsite.auc.dk
> For additional commands, e-mail: linuxgames-help@sunsite.auc.dk
> 
> 

        -Erik <erik@smluc.org> [http://math.smsu.edu/~br0ke]

The opinions expressed by me are not necessarily opinions. In all
probability, they are random rambling, and to be ignored. Failure to ignore
may result in severe boredom or confusion. Shake well before opening. Keep
Refrigerated.