I'm a newbie on OpenSceneGraph and 3D development.
I have a dxf file that contains a bunch of 3DPOLYLINES (with different
colors). So far I have been able to read and display them on a viewer, but I
haven been able to change the color of the rendered lines. I believe that I'm
not understanding
Hello Chris,
Thank you for your answer.
My code, actually compiles, nevertheless I was expecting a conceptual error
from my side.
I will try what you suggest.
Cheers,
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75217#75217
__
Hi,
The suggestion of Chris solve the problem.
The actual code:
Code:
osg::Node* lines = osgDB::readNodeFile("lines.dxf");
osg::Geode* geode = new osg::Geode;
ColorVisitor newColor;
newColor.setColor( 1.0f, 0.0f, 0.0f );
topography->accept(newColor);
geode->addChild(lines);
_mViewer->setScen
Hello,
I'm trying to change a node color on demand from my application. The idea is
that the user, once the initial rendering took place can change the color of a
node by pressing a key (or something similar). I know already hoy to change the
color using a NodeVisitor (previous to the rendering
Hello Eran,
Thank you very much for your answer. I should have been more explicit, due to
the fact than I'm a newbie on OSG (and 3D development).
I have an OSG viewer embedded on a Qt5 application. So the idea is that the
user can change the color of one node (some dxf lines) on demand though
Hello Eran,
Thank you again.
I will try what you suggest.
Cheers,
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75244#75244
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://
Hello,
I have tried Eran's suggestion with no success. I have successfully created the
handler, and it gets called but no color change...
My current code:
On main:
Code:
_lines = osgDB::readNodeFile("lines.dxf");
_topo->setDataVariance(osg::Object::DYNAMIC);
osg::Geode* geode = new osg::Geode;
Hello Trajce,
The visitor class implementation is on my previous post on this thread. I took
that code from Gordon Tomlison's OSG Samples, and it works when is used
previous to the rendering as you can see on my initial post (other thread:
http://forum.openscenegraph.org/viewtopic.php?p=75209#
Hello,
I'm trying to sppeding up/down an animation using AnimationPathCallback. The
idea is to pause/speed/up/down the animation using key strokes, for this I have
a GuiEventHandler derived class and a NodeVisitor derived class. So far I've
playing round with the base clases AnimationPath and A
Hi,
Thank you for your answer mp3butcher.
Regarding the math issue: actually the arithmethic is correct in my code, the
problem, as I found, was that the _latestTime and _fisrtTime in the
AnimationPathCallback won't match the ones provided in AnimationPath, so I
subclassed AnimationPathCallba
Hello,
I have a couple of doubts regarding the proper way of handling osg::Text
inside an animation.
For the sake of simplicity lets say we are working on the osganimate example,
and we have multiple cessna moving around.
1- What is the proper way of changing the text of osg::Text on runtime
setText("insert dynamically-generated string here");
>
>
> You can show/hide the text with its node mask:
> text->setNodeMask(0x0); // NodeMask = 0 to hide
> text->setNodeMask(~0x0); // NodeMask = 0x to show
>
>
> Hope that helps,
setText("insert dynamically-generated string here");
>
>
> You can show/hide the text with its node mask:
> text->setNodeMask(0x0); // NodeMask = 0 to hide
> text->setNodeMask(~0x0); // NodeMask = 0x to show
>
>
> Hope that helps,
Hello,
I'm drawing some simple lines on osg. So far I have successfully draw the
lines and set a single color for each of them... but when I rotate the view the
color is shown only on one direction of the camera, for instance, if rotate on
180 degrees the view, all lines are shown in black (lo
Hello ravidavi,
Thank you for your answer. Your suuggestion solved my problem.
Cheers,
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75348#75348
___
osg-users mailing list
osg-users@lists.opensce
Hello,
I have several AnimationPath intances for a number of moving objects. Each
object has the same number of ControlPoints on their path.
I need to know if there is a proper way to retrieve the current time of the
animation (using a callback, for instance). I need this number in order to
d
Hello Robert,
First of all, thank you for your answer. I'm just starting to use OSG so I'm
learning as I go.
So, my issue is a little more complicated (I think).
I have serveral AnimationPath instances. Each one with a AnimationPathCallback
derived class attached to it. So, the thing is that
Hello Robert,
Thank you again for your answer.
Regarding your question "the AnimationPathCallback::update method)?": yes, from
the source:
Code:
void AnimationPathCallback::update(osg::Node& node)
{
AnimationPath::ControlPoint cp;
if (_animationPath->getInterpolatedControlPoint(getAnim
Hello Robert,
Thank you very much for you complete response.
I'm trying to do what you suggest and have my on
AnimationPath/AnimationPathCallback classes that handle my data. But I stumble
into a problem.
When I subclass AnimationPath and AnimationPathCallback I have no problems.
But when I
Hello Robert,
Thank you again.
It turns out that I forgot to initialize the _timeMultiplier variable on the
constructor of my AnimationPath class. Also I had a problem with some crazy
references retrieved wrongly: for some reason on a "for (auto e: stl_map)..."
loop, &e.second, was not gettin
Hello,
This is a mixed OSG/Qt question. I asked first here due to previous
experiences with the community.
I'm following a minimal example of embedding OSG into a Qt5 application from
https://gist.github.com/vicrucann/874ec3c0a7ba4a814bd84756447bc798. When I
modify that example, and add a s
Hello,
I'm trying to draw a bounding box around a osgText::Text instance. Setting the
draw mode to 'osgText::Text::TEXT|osgText::Text::BOUNDINGBOX' draws a white box
around the text. Does anyone knows a simple way to get this box color match the
text color? Or, better yet, a way to draw the box
Hello,
I've found a workaround my problem. I had to inherit a class from
osgText::Text and override the drawImplementation method like so:
Code:
void MyTextNode::drawImplementation(osg::RenderInfo& renderInfo) const
{
osg::Vec4 color = getColor(); # stored custom color
osgText:
Hello,
I've playing aorund with some examples on the "OpenSceneGraph 3 Cookbook" by
Wang and Quian. Specifically, with Chapter 10's "Playing with delaunay
triangulator".
Here is the official repository code (with one small modification -commented-)
Code:
int main(int argc, char** argv)
{
24 matches
Mail list logo