- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I'm trying to understand something about viewport 2.0 geometry overrides. I'm a bit new to this, so bear with me. I have a node plugin derived from MPxLocatorNode which is drawn in the viewport as a plane. There's a polyPlane mesh being fed into the locator which is being used to drive the locator's shape. This plane has no subdivisions, so it's just 4 vertices. The way the shape is being driven is by using the plane node to initialize an MGeometryExtractor in the locator's associated MPxGeometryOverride class. The same extractor is used to initialize the MIndexBuffer. What I need to do is to modify the vertex positions from existing point positions which are in world space. The MGeometry and MGeometryRequirements objects that are passed into the populateGeometry() method are used to generate an MVertexBuffer, but when I examine this vertex buffer the 12 floats that should be representing the current vertices are not world space positions but just values between -0.5 and 0.5, like this...
-0.5, -0.5, 0, 0.5, -0.5, 0, -0.5, 0.5, 0, 0.5, 0.5, 0, 0
The data I want to replace it with looks like this...
-38.6714, 13.4587, -50, 38.6714, 13.4587, -50, 38.6714, -13.4587, -50, -38.6714, -13.4587, -50
but when I plug those values into the vertex buffer, the mesh plane goes haywire. Can anyone tell what this -0.5 to 0.5 range means and how I can set the vertex positions from world space data?
Thanks.
Solved! Go to Solution.