Attempting to build a renderable ring item
by Rex Hiebert · in Torque 3D Professional · 08/12/2009 (8:26 am) · 5 replies
For a project I am working on, I need to show a circular area. I started by pulling the code from the fxFoliageReplicator object since it has that nice indicator ring. I've been able to modify it so that it looks like what I want but am having trouble with one thing. Culling. At least, I think that's the problem. In the foliage replicator it goes through an involved process to create the bounds. I'm keeping mine simple as it is always just the ring that is shown. But the ring still blinks out when it should be on screen.
I also tried looking at the renderObjectExample and it seems to set the bounds in a different way.
What I would like to know is what function needs to be called or what object.member needs to be updated so the bounds are correct? So that the ring won't blink out at the wrong time and the bounds corners show up correctly in the world editor? Is this done in object space or world space?
Thanks!
I also tried looking at the renderObjectExample and it seems to set the bounds in a different way.
What I would like to know is what function needs to be called or what object.member needs to be updated so the bounds are correct? So that the ring won't blink out at the wrong time and the bounds corners show up correctly in the world editor? Is this done in object space or world space?
Thanks!
#2
Very confusing and I don't really find anything in the docs that helps.
08/12/2009 (10:20 am)
What about when the radius changes and I need to change the bounds to match? I tried setting the values again and calling resetWorldBox() but it didn't create the box at the size expected. I also noticed a call in renderObjectExample that called setRenderTransform(mObjToWorld) instead of the call to setTransform(mObjToWorld) that is in the Foliage module. What is the difference between the two? What are they used for? Do I need to convert local to world or world to local before changing the box?Very confusing and I don't really find anything in the docs that helps.
#3
Most likely, your calculation of the box size is incorrect, if you're not getting the box size you expect. Mind showing how you're determining the box dimensions based on your radius?
08/12/2009 (10:24 am)
@Rex, yes, when the radius changes, you will want to use it to calculate a new mObjBox, then call resetWorldBox again (after you set the mObjBox).Most likely, your calculation of the box size is incorrect, if you're not getting the box size you expect. Mind showing how you're determining the box dimensions based on your radius?
#4
08/15/2009 (1:25 am)
One thing that you might be missing is that you will need to make sure to send the radius property change across the network to the client "ghost" of the object and recalculate the client object's bounds as well.
#5
I'm also not sure how to deal with the scale setting. Do I just multiply the dimensions in my render code or is there a way to set that somewhere else? As I've stated, most of this is based off of the indicators for the fxFoliageReplicators. They don't pay attention to scale so I'm not sure I really want to mess with it but it seems odd to have the scale setting on the property page when it doesn't work.
08/18/2009 (4:28 pm)
Yeah, it looks like the network issue was part of the problem. I'll have to look at how to keep the two updated. I have the size of the rings changing on request but still not sure about the bounding box. When in world editor the white corners of the object don't change from their initial setting even when i change the radius but the ring doesn't disappear too early like it did before. If I save the scene and reload, the bound markers show the updated bounds correctly.I'm also not sure how to deal with the scale setting. Do I just multiply the dimensions in my render code or is there a way to set that somewhere else? As I've stated, most of this is based off of the indicators for the fxFoliageReplicators. They don't pay attention to scale so I'm not sure I really want to mess with it but it seems odd to have the scale setting on the property page when it doesn't work.
Associate Manoel Neto
Default Studio Name