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

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 11 November 2012   #1
Question [C++] Drawing in viewport outsite the bounding box

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.


Last edited by spider853 : 11 November 2012 at 11:56 PM.
Old 11 November 2012   #2
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.

Last edited by Klunk : 11 November 2012 at 11:41 PM.
Old 11 November 2012   #3
Thanks, sorry my wrong actually I've added
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,
Old 12 December 2012   #4
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
Old 01 January 2013   #5
have you tried calling....
GraphicsWindow::enlargeUpdateRect  (  NULL) 

to force max to redraw the whole window ?
Old 01 January 2013   #6
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.
Old 01 January 2013   #7
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
Old 01 January 2013   #8
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 04:45 PM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.