SetDrawParameter & LineZOffset



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 27/09/2006 at 00:39, xxxxxxxx wrote:

    In that case use
    bd->LineNew(p1,p2,0)

    and draw the lines twice
    // normal pass
    bd->SetDrawParam(DRAW_PARAMETER_SETZ,DRAW_Z_LOWEREQUAL)
    bd->SetTransparency(0)
    DrawStuff(bd)
    // dotted pass
    bd->SetDrawParam(DRAW_PARAMETER_SETZ,DRAW_Z_GREATER)
    bd->SetTransparency(-128)
    DrawStuff(bd)
    // reset parameters
    bd->SetDrawParam(DRAW_PARAMETER_SETZ,DRAW_Z_LOWEREQUAL)
    bd->SetTransparency(0)

    this should work



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 27/09/2006 at 08:22, xxxxxxxx wrote:

    Howdy,

    Thanks Michael, but it still seems to depend on where the geometry is in the OM. Actually I am already drawing the lines twice. I'm trying to give the user an option, via a checkbox, to see the joints in front of the geometry, because as they are now, the user can only see the joints if the geometry is in XRay mode.

    Geometry below the joints in the OM:

    Geometry above the joints in the OM:

    As you can see, it draws nicely when the geometry is above the joints in the OM, but I'd like it to draw like that no matter where the geometry is in the OM.

    If I place GePrint() statements in the Draw() function, I find that the joint's Draw() function only gets called once with the flag DRAWPASS_OBJECT, unless it is the active object then it gets called three times, once with the flag DRAWPASS_OBJECT, and twice with the flag DRAWPASS_HANDLES.

    DRAWPASS_BOX and DRAWPASS_HIGHLIGHTS never get passed to the joint object's Draw() function.

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 28/09/2006 at 01:57, xxxxxxxx wrote:

    Aw.. damn.. you are right of couse.. what i told you can't work. It works fine for tools because they draw after objects. Even if you paint with inverted Z test, the next object will still paint above these lines.

    I'm wondering how bones are implemented. They seem to have no problem.

    Perhaps the only way to get your lines is to use a scenehook plugin. If you can make it draw after the objects drawpass, then you could just loop over all your bones and do the drawing as i mentioned it above.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 28/09/2006 at 09:33, xxxxxxxx wrote:

    Howdy,

    Well, it looks like a SceneHookData() may not work. The documentation says this: "This is a data class to register a function that will be called on every scene prepare, for example before redraw and before rendering." From what that says, it gets called before drawing, so that doesn't sound like it could work.

    I'm curious though, is it possible to call an object's Draw() function from within a tag's Draw() function, and would it be safe to do that? I mean if both tag and object Draw() functions are normally called from within the same thread, it should be safe, right? Maybe? It sounds logical, but then I don't have enough experience with C++ to know for sure.

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 28/09/2006 at 14:27, xxxxxxxx wrote:

    You should really test when Draw is called. What the docs mention is about the Execute function.

    Theoretically it should be safe. However first you must get a pointer the corresponding ObjectData instance for your object. The safest way to do it is probably by using the message function with MSG_RETRIEVEPRIVATEDATA. And return/send whatever data you need. You could actually send the BaseDraw Pointer and call the object draw function as reaction on the message.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 28/09/2006 at 14:56, xxxxxxxx wrote:

    You can also get the node data using something like this (not illegal and it works) :

    MyObject* myo = static_cast<MyObject*>(obj->GetNodeData());

    This allows you to call methods in your ObjectData. Just make sure to check for NULL and heed the advice about virtual functions.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 28/09/2006 at 15:30, xxxxxxxx wrote:

    Howdy,

    Well, thanks for all the help, but I may end up abandoning the idea.

    I noticed that the tag's Draw() function gets called three times, and that seems a bit too often to be branching out to each joint just to draw them on top of the polygon mesh. :o(

    Anyway, I am curious to know how the bones are doing it, though.

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 29/09/2006 at 03:28, xxxxxxxx wrote:

    GetNodeData(), thanks for the hind. I was looking for something like this, but could not find it.

    I still suggest that using a SceneHook will work. It allows more control over when the drawing happens ( highlight pass ) and the draw function should always be called. I'm convinced that bones are drawn this way.

    It would be nice now to know for sure... Mikael ? David ?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 29/09/2006 at 09:28, xxxxxxxx wrote:

    Howdy,

    > Quote: Originally posted by Michael Welter on 29 September 2006
    >
    > * * *
    >
    > GetNodeData(), thanks for the hind. I was looking for something like this, but could not find it.
    >
    >
    > * * *

    Yes, I knew about that. It works well for being able to communicate between your plugin classes, to retrieve pointers to stored data.

    > Quote: _I still suggest that using a SceneHook will work. It allows more control over when the drawing happens ( highlight pass ) and the draw function should always be called. I'm convinced that bones are drawn this way.
    >
    > * * *
    _


    I may give that a try, but maybe for the next update of the plugin. ;o)

    > Quote: It would be nice now to know for sure... Mikael ? David ?
    >
    > * * *
    >
    > * * *

    Yes, I would like to know for sure, too.

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 04/10/2006 at 11:43, xxxxxxxx wrote:

    It's surely a hack to call the object's Draw() function from the tag's, but I can't see how it could be dangerous. More like code reuse... :-)
    The Scenehook solution might be the simplest, though, provided that its Draw() function is always called after objects'.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 05/10/2006 at 20:24, xxxxxxxx wrote:

    Howdy,

    Thanks Mikael, I'll consider giving that a try when I do another update. ;o)

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 06/02/2007 at 13:48, xxxxxxxx wrote:

    Dan,

    Did you ever find a solution here and what was it? :)

    I am looking into something similar for my bones while some other related features are added.

    If you went with a SceneHook, how do you do the drawing? Do you recurse the document's objects for you own and draw them then?

    Thanks!

    Robert



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 06/02/2007 at 13:58, xxxxxxxx wrote:

    Howdy,

    Nope, not yet. :o(

    Actually, I haven't tried it anymore, and just went on to other things.

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 06/02/2007 at 14:18, xxxxxxxx wrote:

    Hello Dan,

    Nothing huh?

    Well, if I find a way, it will be posted here. :)

    Thanks!



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 06/02/2007 at 14:25, xxxxxxxx wrote:

    Howdy,

    Cool, good luck with it.

    It just seemed like too much to do, and there were more important things for me to solve.

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 03/06/2007 at 11:10, xxxxxxxx wrote:

    Howdy,

    OK, I think I'm going to give this a shot again, but I have no idea how to use a scene hook or how to even set one up. There is no example of a SceneHookData plugin in the SDK project. I've found some bits and pieces of code here on the cafe, but not a complete example.

    I'm going to see if I can figure this out from the bits and pieces, but I'll welcome any complete example anyone is willing to share. ;)

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 04/06/2007 at 22:56, xxxxxxxx wrote:

    Howdy,

    Well, I figured out how to set up the SceneHookData and it works!

    Seems that if I draw in screen coordinates using the 2D drawing functions, it draws on top of the polygon mesh using the SCENEHOOKDRAW_ACTIVE_PASS flag. Since I'm only drawing lines anyway, that works out great.

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 05/06/2007 at 12:44, xxxxxxxx wrote:

    Great news, Dan!

    Please post a screenshot so we can see the cool results (this could be over at CGTalk if you like).



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 05/06/2007 at 13:46, xxxxxxxx wrote:

    Howdy,

    Here is the result:

    I had to write my own dotted line drawing routine, though, using BaseDraw's Point2D() function.

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 05/06/2007 at 21:36, xxxxxxxx wrote:

    Very nice, Dan. I may have to speak with you on how you accomplished this with a SceneHook in the future. :)

    Take care,


Log in to reply