Rendering iDraw Triangles...

Technical discussions
Post Reply
arg25
Posts: 5
Joined: Mon May 01, 2023 3:52 pm

Rendering iDraw Triangles...

Post by arg25 »

Hello,
I am porting over some of our OpenGL code which renders some triangle facets (similar to STL).

In OpenGL, we use the glBegin statement, set to triangle type, and add the 3 vertexes, and finally call glEnd statement.

I'm using VB6 and DG kernel OCX, using iDraw entity. It works for Points, Lines, but it does not work for triangles?

Any assistance you can provide? Here is my approach...

Set IModel = picDGViewer.GetModel()
Set m_iDraw = IModel

Call m_iDraw.PushAttrib

Call m_iDraw.Begin(eTrianglesDG)
for i = 0 to MyFacetCount - 1
Call m_iDraw.Vertex(vert1(0), vert1(1), vert1(2))
Call m_iDraw.Vertex(vert2(0), vert2(1), vert2(2))
Call m_iDraw.Vertex(vert3(0), vert3(1), vert3(2))
next i
Call m_iDraw.end


Call m_iDraw.PopAttrib
picDGViewer.UpdateView

Prashant Kande
Posts: 121
Joined: Mon Apr 04, 2016 4:55 am

Re: Rendering iDraw Triangles...

Post by Prashant Kande »

Hello
Sorry for the late answer.
It should work. I will dig a little deeper and post something here shortly.
Regards

Prashant Kande
Posts: 121
Joined: Mon Apr 04, 2016 4:55 am

Re: Rendering iDraw Triangles...

Post by Prashant Kande »

My quick test does show a problem in a C# test. We will fix it shortly. It might not be related to your issue. I need to dig a little deeper to reproduce it on a native DGK.

Meanwhile: IDraw_DG was intended to draw only few auxiliary items. For anything other than a tiny mesh, a direct definition using mesh-related interfaces IMesh_DG, etc. are recommended. See Morph sample for the code. Logic in your app should be pretty close.

Regards

Prashant Kande
Posts: 121
Joined: Mon Apr 04, 2016 4:55 am

Re: Rendering iDraw Triangles...

Post by Prashant Kande »

Yes. The native control has also the problem.

Code: Select all

void IDraw_DGTest::Triangles()
{
    IDraw_DGPtr iDraw = m_iModel;
    IEntity_DGPtr iEntity;
    iDraw->Begin(DrawPrimitive_DG::eTrianglesDG);
    iDraw->Vertex(0, 0, 0);
    iDraw->Vertex(1, 0, 0);
    iDraw->Vertex(0, 1, 0);
    iDraw->End(&iEntity);
    m_view->Reset(true, true);
}
There should be an update with a fix soon.
Thanks for reporting.

Prashant Kande
Posts: 121
Joined: Mon Apr 04, 2016 4:55 am

Re: Rendering iDraw Triangles...

Post by Prashant Kande »

Done.
5385 (or later) is the update number.
It works now in both native and DGKC editions.
Thanks for reporting.

Post Reply