[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
  11 November 2012
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.
  11 November 2012
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.
  11 November 2012
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,
  12 December 2012
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
  01 January 2013
have you tried calling....
GraphicsWindow::enlargeUpdateRect  (  NULL) 

to force max to redraw the whole window ?
  01 January 2013
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.
  01 January 2013
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
  01 January 2013
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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
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 01:51 AM.

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