Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 8569

Surface Zebra Stripes During Dynamic Draw (C++)

$
0
0

@robert.beck12569 wrote:

Hello,

I am working on creating a C++ plugin that allows a user to manipulate surfaces indirectly using a control mesh. The idea is that the user will move mesh vertices around, and as the vertices move, the underlying surfaces should update. Below are a few images demonstrating this:

Here is the start:
image

This is what it looks like when the user selects a point:
Before_Move

This is how it looks after the user drags the point (imagine the surfaces moving with the point):
After_Move

The reason for this post is that I want to figure out how to apply zebra stripes to the surfaces while I move the point around. I understand Rhino has a Zebra command, but I don’t know how I would be able to use it in my case.

Here is how I am drawing the surfaces:

void CRhinoGetTranslationPoint::DynamicDraw(CRhinoDisplayPipeline& dp, const ON_3dPoint& point)
{
	if (draw)
	{
		const CDisplayPipelineAttributes* attrs = dp.DisplayAttrs();
		CDisplayPipelineMaterial dpm = *attrs->m_pMaterial;
		dp.SetupDisplayMaterial(dpm, &m_doc, nullptr);

		for (size_t i = 0; i < patches.size(); i++)
		{
			ON_Brep* b = patches.at(i).BrepForm();
			dp.DrawShadedBrep(b, &dpm, nullptr);
			delete b;
		}
	}

	CRhinoGetXform::DynamicDraw(dp, point);
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 8569

Trending Articles