This seems like the age-old "you can't draw a flat-shaded cube with 8
vertices" dilemma.

Don't you need to repeat the same xyz vertex possibly multiple times? So
that you can have a different normal at the same vertex, depending on which
face you're rendering.
   -Paul


On Wed, Jul 23, 2014 at 8:25 AM, Yu Zhang <sciro...@163.com> wrote:

> Hi everyone,
>
> Could anyone share some experience on handle 3D hole drawing?
> My implementation seems not good, the details are:
>
> Suppose a small rect is a hole inside a big rect:
> [img]http://www.youpic.tk/view.php?filename=706Hole.png[/img]
>
> The vertices are 0, 1, 2, 3, 4, 5, 6, 7. I'll do:
> 1) for extrusion direction, add some vertices in top plane. vertex 8, 9,
> 10, 11, 12, 13, 14, 15. Each vertex is offset from a bottom vertex. eg: 0
> ->8,
> 1 -> 9...
> 2) Use tessellator to process the bottom plane, get some prim sets with
> triangles.
> 3) For each triangles in bottom, add a side face prim set from top plane
> triangle. eg, for triangle 236, use 10, 11, 14. The side face's triangle
> strip is 2, 10, 3, 11, 6, 14, 2, 10.
> 4) Add all side faces for each triangles, add bottom, top planes.
>
> The result looks correct, but it have unnecessary side faces inside model.
> It sounds do no harm, but if it enable lighting, the look feel is not good:
> [img]http://www.youpic.tk/view.php?filename=474NotgoodLighting.png[/img]
>
> Turn off lighting seems ok, but it lacks lighting. Maybe this is more like
> a modeling question, could you please share your experience, thanks!
> Attached the picture also.
>
> Thank you!
>
> Cheers,
> Yu[/img]
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=60411#60411
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 
   -Paul
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to