Notifications
Clear all

[Closed] [C++] Drawing in viewport outsite the bounding box

Hi,
I’m doing a helper related to trajectories and need to display a helper line (trajectory) for an object.
I’m doing it in Display() method, but the problem is that Display is get called only when the bounding box of the node is inside the camera frustum, but I don’t want to have a bounding box big as line and also I don’t need to select the line, I use bounding box only for selecting the helper icon.
Is there a way to disable frustum culling for the helper line drawing?

I though of using some callback after all drawing is done, to draw my line, but maybe there is a better method?

For example Tape Helper doesn’t have the problem with line that is drawing even if the main node is outside of the screen.

Thanks

6 Replies

add this to your helper class and it will cure your selection brackets

// From Object
  
  int			DoOwnSelectHilite()	 { return 1; }

have a look at…

maxsdk\samples\objects\helpers\Character\Character.cpp

and how it uses class member dumFlags to invalidate the helper mesh to
force a redraw. Not really sure if it’s what you need though.

Thanks, sorry my wrong actually I’ve added
DoOwnSelectHilite
didn’t pay attention that it removed the bounding box. Just remembered that had problems with it and focused at other parts.
As I tried to mimic the ExposeTM helper.
I had a quick look at Character.cpp, and looks like its using mesh for displaying.
I’m using GraphicsWindow to draw the lines, so I don’t have BuildMesh method
Anyway, I’ll have a more in deep look tomorow,
Thanks

Sorry for late reply,
I ended to draw in Display and making a big bounding box including all the points
still there are some times when max doesn’t call the display even the hitbox is in front of camera

have you tried calling…

GraphicsWindow::enlargeUpdateRect  (  NULL) 

to force max to redraw the whole window ?

No, but where it should be called?
because I have data to display not at a particular time, but always in viewport, so I relate to display function.

try it in the display() function , see if it cures the non draw issue and whether it kills frame rate in complex scenes I suppose