To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 6982
6981  |  6983
Subject: 
Re: DirectX and .dat
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 27 Feb 2002 17:44:07 GMT
Viewed: 
416 times
  
In lugnet.cad.dev, Roland Melkert writes:
Hi all.

Tim Courtney directed me to this forum on an issue that's bugging me.

I am into the Virtual Lego for about a year now and being a programmer
i started to mess around myself with the dat files etc.

Just for the fun of it I started a little project on displaying a ldraw
model using DirectX 7 (In delphi 5 std). I managed to get the recursive
reading of the files just fine and I am now able to draw a wireview of a
model. But I am having problems converting the coordinates into normals
and vertices. As of a result most of the polygons are kinda inseout or
something. I found out about the triangle decompiling of directx and
corrected some of the poly's but it's still not right. (I can place a p
mugshot on my website of current results if needed)

Is there someone here who can direct me to some information about this
translation problem or exemples.

I discovered in this newsgroup the ldview program and it's source, but
is this compatible with directx or should i shift to opengl alltogether?

I am only a beginner in 3D and directx so this project of mine is more a
learing thing than creating a usefull program at the moment.

You're probably running into trouble with the random polygon winding
direction in most of the LDRAW parts.  This causes problems with
lighting and culling since the normals often point into the part rather
than out of it.  In opengl you can solve the problem at the cost of
some speed by treating back facing polygons the same as front facing
polygons and disabling backface culling.  An alternate method would
be to take the dot product of each polygon normal with the view vector
and reverse the order of the points in the polygon whenever the dot
product is positive.  This would turn all the polygons to face the
viewer.  None will ever be culled, but at least they'll get lighted
correctly.

Don



Message has 1 Reply:
  Re: DirectX and .dat
 
(...) One other option (that I just added to LDView in OpenGL) is to use two directional lights that face in opposite directions. This probably won't work for the specular component, as the specular calculation actually requires the normal to be the (...) (23 years ago, 27-Feb-02, to lugnet.cad.dev)

Message is in Reply To:
  DirectX and .dat
 
Hi all. Tim Courtney directed me to this forum on an issue that's bugging me. I am into the Virtual Lego for about a year now and being a programmer i started to mess around myself with the dat files etc. Just for the fun of it I started a little (...) (23 years ago, 27-Feb-02, to lugnet.cad.dev)

6 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR