Subject:
|
Re: The use of type 5 lines for smoothing of objects.
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Wed, 8 May 2002 19:50:32 GMT
|
Viewed:
|
533 times
|
| |
| |
Hmmm, Finally a use for the type 5 lines I've been ignoring :)
(I have another - so far successful - way of drawing in those lines)
Martijn Zwaal wrote:
> > One thing that someone noted (I think it was Don Heyse) when I mentioned
> > this was that it might be possible to instead check for the lack of type 2
> > lines of color 24 between two adjoining faces, and use this as an
>
> indicator
>
> > that the two faces should be smooth shaded. This would solve the problem
>
> on
>
> > the inside of the minifig hand, but it may produce smooth shading in
>
> places
>
> > where it is undesirable. Most of these could probably be avoided by
>
> having
>
> > a maximum difference in angle between the two faces. On the other hand, I
> > think your algorithm would be MUCH easier to implement.
Well alot of this leads in a direction I've mentioned before. Which is adding
strip and mesh info into the part, and primitive files. Generaly you do do
this smothing inside a strip or mesh, and then you start a new strip or mesh
where you want a real edge.
The rendering engine I use has a facility to join quads/triangles into strips
and meshes, and does have an angle thresh hold that can be passed in to determine
where there should be a 'creased' edge. I haven't tried to use it yet.
One thing about looking for the absence of the type2 lines is that there isn't
any guarantee that they'll be any where near the quad in the DAT file, and
searching all the loaded lines could be computationally expensive with the
wrong algorithm. Once you found it wasn't there you also need to then search
for the adjoining quad and determine whic of it's points you should use to
try to determine the vertex normal.
My code currently does do lighting/shading using vertex normals, but since
each vertex's normal was computed using the neighboring vertices of the same
polygon, all the vertices (should) end up with the same normal, which of course
gives this faceted look.
I need to review the idea that Martijn posted earlier, but since the type 5
lines usually have (in the same line) at least one control points that are
shared by the polgon that shares that edge, that should be very useful in
computing a vertex normal that is more correct for smoothing.
Martijn, do you have any real code you can share?
-Kyle
> > --Travis Cobbs (tcobbs@REMOVE.halibut.com)
>
>
> This looks indeed like a more general way to do it. A big problem however
> will be complex patterns on a face, like on a shield. There will be a lot
> useless checking, because for every edge in a face you have to check for a
> color 24 line. If not present you have check for neighbors are in the same
> plane or not. You also may have to look beyond the scope of the dat file to
> see how primitives or sub files are connected. This will increase complexity
> enormously. In the optional line case it is possibly to stay in file scope
> (in almost any case, and in any case if border optional lines are added).
> There is also the orientation problem in non-bfc files. It is easier to
> adapt current files by inserting type 5 lines at edges that are smooth,
> because type 5 lines are more or less meant for that. This can be done
> without backward compatibility issues. The only drawback is decreased
> performance when viewing with viewers that actually use optional lines to
> draw a contour.
> Modern viewers with perspective view should also be able to display optional
> lines to draw a contour. This can be done in almost the same way as in an
> orthographic view, but now you check if the last 2 points are on the same
> side of the plane, defined by the first 2 points and the point of view. This
> is the general case of the optional algorithm.
>
> Martijn Zwaal
--
_
-------------------------------ooO( )Ooo-------------------------------
Kyle J. McDonald (o o)
|||||
\\\//
(o o) kmcdonald@BigFoot.COM
-------------------------------ooO(_)Ooo-------------------------------
|
|
Message is in Reply To:
| | Re: The use of type 5 lines for smoothing of objects.
|
| (...) indicator (...) on (...) places (...) having (...) This looks indeed like a more general way to do it. A big problem however will be complex patterns on a face, like on a shield. There will be a lot useless checking, because for every edge in (...) (23 years ago, 8-May-02, to lugnet.cad.dev)
|
22 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|