[osg-users] Conical and Parallel Projections

2009-01-13 Thread Renan Mendes
Hi,

I'd like to know if there was a way to change the default projection in
OSG. By default the view uses conical projection, but in some situations I'd
need a parallel projection. How can I do that?

   Thanks,

 Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Conical and Parallel Projections

2009-01-13 Thread Renan Mendes
Thanks J-S and Gordon, that was exactly what I wanted.

I'm sorry about the terminology, I was just translating literally from
Portuguese, since I'm not familiarised with the terms in English.

Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] World to Local Coordinates

2008-12-22 Thread Renan Mendes
Hi,

I wanted to have the position of a certain shape of my scene in relation
to another shape's coordinate system. As I read in the documentation, there
is a member function of MatrixTransform that computes WorldToLocalMatrix,
but I'm not sure on how to use it properly. This function has two arguments:
a reference to a matrix and a pointer to a NodeVisitor. My questions are:

1) Which matrix goes on the matrix type argument? A blank matrix? The
matrix of the shape I'm willing to get its coordinates transformed?
2) What do I have on the resultant matrix?
3) What is the NodeVisitor for?

   Thank you,

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] World to Local Coordinates

2008-12-22 Thread Renan Mendes
Vincent,

 Thanks for your help, but what I want is exactly the opposite. To
transform from world to local... Does anybody know the answer to my last
email?

   Thank you.

  Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Problem with moving a group

2008-12-13 Thread Renan Mendes
Hi, everyone.

In my application the user is suuposed to be able to select several shapes
(cylinders, boxes and spheres) and move them altogether as if they were one.
The obvious solution would be to attach this group of shapes to a
matrixtransform node, and only change the matrix of this node.

The thing is: the classes that I have created to represent each one of those
shapes have a few attributes that change according to the position and
orientation of the shape. So, I have created a method
movePrimitive(osg::Matrix m) to perform the transformation of the shape
itself and the adjustment of the mentioned attributes. So, if I use that
matrixtransform node I talked about, the primitives will be
rotated/translated accordingly, but the attributes won't be changed.

Just so you know, the attributes are osg::LineSegment and osg::Plane
pointers and what I do in movePrimitive(osg::Matrix m) is multiply the
osg::LineSegments and osg::Plane by that matrix. osg::LineSegments and
osg::Planes are not nodes, so I can't attach them to my primitive. So what
do you think I can do?

Thanks,

Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Using OSG on Windows on Bootcamp

2008-12-11 Thread Renan Mendes
Hi,

I have a MacBook and I'm using OSG on Windows, installed with bootcamp.
My application doesn't detect the right mouse button even though I am using
a regular two-button mouse (Microsoft's). I was wondering if anyone stumbled
upon anything of the kind and could tell me wether the problem is the
running windows on bootcamp or not. Here's the code I'm using:

(inside handle method)
switch(ea.getEventType()) {

case(osgGA::GUIEventAdapter::RIGHT_MOUSE_BUTTON):
cout  right button  endl;
break;

case(osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON):
cout  left button  endl
break;

default:
break;

}

Thanks a lot.

 Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Using OSG on Windows on Bootcamp

2008-12-11 Thread Renan Mendes
Thanks, Robert, that really helped.

Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Creating window

2008-12-10 Thread Renan Mendes
Hi,

   I'm currently running my application on full screen mode, because that's
the default configuration. I wanted to know how to change this configuration
to a true window.

  Thanks,

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Creating window

2008-12-10 Thread Renan Mendes
Well, this is simple. Thanks!
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Picking

2008-12-10 Thread Renan Mendes
Hi,

My question is regarding picking using LineSegmentIntersector. Based on
what I have seen at the osg documentation, the following steps are required
to get the coordinates of the intersection between a drawable at the scene
and a line segment:

1) Create a LineSegmentIntersector:
   osgUtil::LineSegmentIntersector* lineSegmentIntersector = new
osgUtil::LineSegmentIntersector(lineStart, lineEnd); // lineStart and
lineEnd are fictitious
2) Get the first intersection:
   osgUtil::LineSegmentIntersector::Intersection intersection =
lineSegmentIntersector-getFirstIntersection();
3) Get world coordinates of the intersection
   osg::Vec3f pos = intersection.getWorldIntersectPoint();

Assuming that this is right, I ask one thing: how to use the mouse
coordinates to create a line that will intersect the drawable upon which the
mouse cursor stands?

Thanks again.

   Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Picking

2008-12-10 Thread Renan Mendes
Thanks, J-S.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Text at fixed position on screen

2008-12-09 Thread Renan Mendes
Hi, Dusten.

I've looked at the osgtext example, but I couldn't figure out one thing
(perhaps because I didn't know what to look for). There is one piece of text
that says: text-setFontResolution(10,10); // blocky but small texture
memory usage and it is displayed on the top left corner. No matter how much
I rotate the scene, it won't move (this text is one example). That's what I
wanted, so I have searched the code for the above mentioned string and I
found out that this text is created and set like this:

{
osgText::Text* text = new osgText::Text;
text-setFont(font);
text-setColor(fontSizeColor);
text-setCharacterSize(fontSizeCharacterSize);
text-setPosition(cursor);

// use text that uses 10 by 10 texels as a target resolution for
fonts.
text-setFontResolution(10,10); // blocky but small texture memory
usage

text-setText(text-setFontResolution(10,10); // blocky but small
texture memory usage);
geode-addDrawable(text);
}

Where:

osgText::Font* font = osgText::readFontFile(fonts/arial.ttf);
osg::Vec4 fontSizeColor(0.0f,1.0f,1.0f,1.0f);
float fontSizeCharacterSize = 30;
osg::Vec3 cursor = osg::Vec3(margin*2,windowHeight-margin*2,0.0f);

   Strangely enough there was nothing concerning a mode that would make it
fixed at a certain position. I've tried some other attributes but the best I
can do is get the text to be always parallel to the screen, but ot fixed.

   Can you give me another hint?

   Thanks,

   Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Text at fixed position on screen

2008-12-09 Thread Renan Mendes

 What you need are multiple cameras. One moves when navigating in the scene,
 the other doesn´t.  This is done in osgHud.


But why does it work on osgText? I'm not sure I understand.

Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Text at fixed position on screen

2008-12-09 Thread Renan Mendes
It works. Thank you Sukender and Andreas.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Text at fixed position on screen

2008-12-08 Thread Renan Mendes
Hi, everyone.

  I'm using the osgText::Text class to create texts that are always
parallel to the screen. In addition to that, I would like to fix them at a
certain position of the screen, say on given coordinates (x,y). Any
suggestion on how to do it?

   Thanks,

Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgViewer osgCool

2008-12-04 Thread Renan Mendes
Thanks.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgViewer osgCool

2008-11-27 Thread Renan Mendes
Hi, everyone.

 I was looking through the examples and found an effect that can be useful
to my application. It is in osgviewer osgcool, but I can't find the code
neither in the examples I've download with the osg package nor at the osg
website... Does anyone have it and can send it to me?

 Thanks,

 Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgViewer osgCool

2008-11-27 Thread Renan Mendes
My mistake, I thought it was an example but it is only an argument for the
application.

Either way, I really wanted to learn how that particular particle effect was
generated... How can I do it?

Thanks,

Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgViewer osgCool

2008-11-27 Thread Renan Mendes
I will look into that. Thanks J-S.

Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Pergunta

2008-11-04 Thread Renan Mendes
Hi,
In my application, I'm trying to create a point (a small sphere) and
alter its properties, like shininess and transparency. When I execute the
following method, the point is created with shininess effects alright.
However, no matter how much I change the values related to transparency
(values from 0. to 1.), nothing seems to be different in my view...
What do I have to do to get the right result?

osg::Geode* Point::createPoint(osg::Vec3f position)

{

this-geode = new osg::Geode() // geode is an
osg::ref_ptrosg::Geode, member of my class

this-drawable = new osg::ShapeDrawable(new
osg::Sphere(position, RADIUS)); // drawable is an


   // osg::ref_ptrosg::Drawable, member
of my class

this-drawable-setColor(osg::Vec4(0.0, 0.0, 1.0, 1.0));

this-geode-addDrawable(this-drawable);

this-material - setColorMode(osg::Material::DIFFUSE);

this-material - setAmbient(osg::Material::FRONT_AND_BACK,
osg::Vec4(1, 1, 1, 1));

this-material - setSpecular(osg::Material::FRONT_AND_BACK,
osg::Vec4(1, 1, 1, 1));

this-material -
setShininess(osg::Material::FRONT_AND_BACK, 128.0f);

this-material -
setTransparency(osg::Material::FRONT_AND_BACK, 0.5f);

geode - getOrCreateStateSet() -
setAttributeAndModes(this-material.get(), osg::StateAttribute::ON);



return geode.get();

}

Thanks for your help,

Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Pergunta

2008-11-04 Thread Renan Mendes
Hi, Can.
 The stateSet whose mode you are setting is from the drawable or the
geode? And how exactly can I do that without destroying my previous
settings? (geode - getOrCreateStateSet() -
setAttributeAndModes(this-material.get(), osg::StateAttribute::ON);)

 Thanks again,

  Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::Plane

2008-11-04 Thread Renan Mendes
OK, thanks.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osg::Plane

2008-11-03 Thread Renan Mendes
Stupid but fast question. Just want to make sure I'm getting it right, as
notations can vary and there is no explanation at the reference docs.
Let's say I have an osg::Plane that can be represented as ax + by + cz + d =
0. The method asVec4() from that class gives me an osg::Vec4 object with x =
a, y = b, z = c and w = d?
Thanks for your answer.

Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Debugging using Visual Studio

2008-11-02 Thread Renan Mendes

 If you get more crashes when doing that, you'll need to be more specific
 and provide for example a stack trace for us to help you find out what's
 going on.


I've realized I wasn't too specific... Next time I'll come with details. But
thanks, anyway.

Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Debugging using Visual Studio

2008-10-31 Thread Renan Mendes
Hi,

Until the present date, I've been using cout's to debug my application,
which is really annoying, for I didn't know how to configure Visual Studio
to be able to debug running a OSG application. At one time I've read how to
do it, but I lost that source... Can anyone teach me how? Thanks.

   Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Callbacks: operator() call

2008-10-29 Thread Renan Mendes
Hi,

I'm having some trouble when using a whole lot of callbacks at the same
time... Apparently it has something to do with the order that they're being
called. I want to know how is it done. Are the operator()'s executed one by
one in a given order or are they executed in a parallel manner?

 Thanks,

  Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] setViewMatrixAsLook at and getViewMatrixAsLookAt

2008-10-27 Thread Renan Mendes
Hi,

 I am using these two methods: setViewMatrixAsLookAt(eye, center, up)
and getViewMatrixAsLookAt(eye, center, up) with the viewer's camera in
this order and WITHOUT manipulating the camera elsewhere in my code. I don't
have much experience with OSG but isn't the last method supposed to return
in the eye, center and up objects the same parameters that I have used to
set the view matrix before? I've made a simple test:

viewer.getCamera()-setViewMatrixAsLookAt(osg::Vec3f(10., -10., 2.),
osg::Vec3f(0., 0., 0.), osg::Z_AXIS);

osg::Vec3f eye;
osg::Vec3f center;
osg::Vec3f up;
viewer.getCamera()-getViewMatrixAsLookAt(eye, center, up);

cout  eye   eye.x() eye.y() eye.z()  endl;
cout  center   center.x() center.y()
center.z()  endl;
cout  up   up.x() up.y() up.z()  endl;

And what I've got from the cout's was:

eye: 10 -10 2 (OK)
center: 9.29986 -9.29986 1.85997
up: -0.0990148 0.0990148 0.990148

What am I doing wrong here? Did I misunderstand the purpose of the
method?

   Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] setViewMatrixAsLook at and getViewMatrixAsLookAt

2008-10-27 Thread Renan Mendes
Thanks, Paul and Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] setViewMatrixAsLook at and getViewMatrixAsLookAt

2008-10-27 Thread Renan Mendes
Now that you have explained to me how it works, maybe you could give me an
idea on how to solve a small problem I have.

In my application, the user can move the camera freely (all directions and
eye positions), but when the camera's direction is close to a given one, it
snaps into that given direction, maintaining though, the distance from the
objects of the scene. My doubt is on how to set the new view matrix if I
can't get from the old matrix the true center of my view...

Any ideas?

Thanks.

Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Events and Key Detection

2008-10-08 Thread Renan Mendes
Hi, everyone. My messages have been kind of ignored these days, but I'll
give it another try with a different problem:

In my GUIEventHandler derived class, I'm doing the usual override of the
osgGA::GUIEventHandler::handle() function. Well, I made that whole
switch-case structure and I would like to know if it would be possible to
get, for example, an event inside another one. Let me give you an example:

switch(ea.getEventType())
{
 case(osgGA::GUIEventHandler::DRAG)
 {
 // Here I'd like to check if a key was pressed -- how can I do
it?
 }
}

I'd appreciate any help.

Thanks,

Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Events and Key Detection

2008-10-08 Thread Renan Mendes
Sorry, Robert, I think I wasn't very clear. What I meant was: when I detect
a drag event, I'd like to also detect a keydown event. It would be like
testing for simultaneity of events...

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Events and Key Detection

2008-10-08 Thread Renan Mendes
Yeah, that was the kind of approach I was thinking in the beginning. I
thought there would be something else. OK, then.

Thanks, Jean and Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Events and Key Detection

2008-10-08 Thread Renan Mendes
Thanks, Robert, that' s some useful information. Another thing: when is the
handle method called exactly? My point is: If I want some other function to
be called continuously, do I have to put it on the FRAME event, or if I only
put it inside the handle method my objectives will be accomplished?

Thanks again,

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Linear Systems Solvers

2008-10-02 Thread Renan Mendes
Hi, there.

  I was wondering if there were any preexisting member functions that solve
linear systems of 2 and 3 variables, already considering cases of numerical
instability. I could create my own method, but I would be a little insecure
about these particular situations...
  If anyone know that, please answer.

Thanks,

  Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Camera control and view matrix

2008-09-18 Thread Renan Mendes
Hi, Robert.
You've said:

As for examples of manage the view matrix, there should be examples in
the archives, but in the end it all boils down to not using a
CameraManipulator and instead calling on each frame:

 viewer.getCamera()-setViewMatrix(viewMatrix);

How do I stop using the default camera manipulator, that I believe is
TrackballManipulator? Thanks.

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Camera control and view matrix

2008-09-17 Thread Renan Mendes
Hi,

I need some references on camera control and view matrices. The tutorial
in OSG's website is outdated, for it still makes use of osg::Producer. Can
anyone send me a few suggestions?

 Thanks,

   Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Texture, Materials and Effects

2008-08-03 Thread Renan Mendes
Thanks, Robert. I'll have a look.

Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Texture, Materials and Effects

2008-08-01 Thread Renan Mendes
Hi,

 Is there any example that deals with simple-to-use effects, change of
texture, etc, so I can make my scene a little bit more attractive? Like
making drawables have a metallic appearance.

  Thanks,

  Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] MultiThreads in OSG

2008-05-07 Thread Renan Mendes
Thanks, Robert, for the tips. My intention when using multithreading is to
try and solve a problem about an input device (I don't know if you remember
me posting it). Well, the thing is, I'm putting the function that gets my
device's output in the FRAME loop. But it locks the normal execution of my
application if I don't touch (i.e. activate) my input device. That's why I
needed another thread: to get another 'route' when my device wasn't
activated.

I don't know if you or Paul have already suggested that I added my class as
a new Event Handler to the viewer doing some modifications which I don't
recall. I'll look into the archives for that message, and perhaps I'll
continue that topic to get some more details abput your solution.

Thanks again.

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Using OSG NodeKits

2008-05-07 Thread Renan Mendes
Hi, everyone.

I'm new to OSG and would like to know how to use the available nodekits,
specially osgVRPN. I've learned from Mike Weiblen that osgVRPN supports my
SpaceNavigator, an input device, but I don't know what are the necessary
steps for that to work. Can anyone explain to me what to do? Please, don't
feel bad in explaining details that seem rather obvious to you.

Thanks in advance,

 Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] MultiThreads in OSG

2008-05-06 Thread Renan Mendes
Hi, everyone.

   I've tried creating another thread in my application using the
windows API (CreateThread, etc), but it seems that this thread has become a
main thread, i.e, my program is not working as a multithreaded
application. In my case, this means that I'm not even displaying the OSG
default screen - all I have is the prompt display, printing some information
I wanted. Does OSG have support for multithreading? Or my problem is
probably misuse of  multithreading?

Thanks,

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Adding input device Part 2

2008-04-22 Thread Renan Mendes
Hi,

 As some of you may remember, i was trying to add a new input device to
my OSG application. This device was the SpaceNavigator. I had access to the
code that gets the 3D coordinates from it any time it is activated. But,
when it is idle, that code makes my application stop and wait for any signal
from SN. I was inserting that loop in the event type FRAME. But, as you may
imagine, when I stopped moving with SN, my application entered that waiting
stage, and the regular cycles of traversal, culling and drawing were
blocked.
 Someone else suggested that I added this device in a new Event Handler
class. Is that right? How do I do that, exactly? Any examples?

  Thanks,

 Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Adding input device Part 2

2008-04-22 Thread Renan Mendes
The best sollution you think, then, is using multithreads?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Disabling mouse cursor

2008-04-15 Thread Renan Mendes
Hi, everyone.

  I begun reading a thread by Guy in which he talked about disabling
mouse cursor, and so I did it: I've instantiated an
osgViewer::GraphicsWindow object, gw, and used gw.useCursor(false), but
nothing happened. I've also tried some other operations, like resizing the
window, etc, but none of them worked. What's missing?

Thanks,

  Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Directory not found

2008-04-10 Thread Renan Mendes
Thanks, Mattias. I have it all working, I just wanted to know why I had to
add those paths in two different locations. I think I have it all figured
out.

 Thanks again,

   Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Directory not found

2008-04-08 Thread Renan Mendes
Hi, everyone.

   I've opened the examples that came with OSG and, after correctly
configuring VS2005 (following step-by-step the installation process), I was
able to compile them. I've tried then, to create a new and very simple
project (with the same paths already configured), with the following code:

#include osg/Node

int main()
{
osg::Node* node = new osg::Node();
}

And the following error was displayed:
Cannot open include file: 'osg/Node': No such file or directory

What am I missing?

  Thanks,

 Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Directory not found

2008-04-08 Thread Renan Mendes
Sorry to ask you this, but is it in Project-Properties-References-Add
Path?

Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Directory not found

2008-04-08 Thread Renan Mendes
Hi, Mattias.

  Thanks for the information. Before that, I was having to use the
examples' projects to create my own project, for I didn't know the whole
configuration process.

   I've got one simple question, tough. You've said in your last email
that:

   The paths can also be added to the MSVC environment:
Tools-Options-Projects and solutions-VC++ Directories

   That's what I had done before. But what is it for? It seems that
compiler won't look for the files needed in the places there specified. I
could really use some information on this.

 Thanks again, and sorry for the trouble.

   Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Dark Side of The Moon

2008-04-06 Thread Renan Mendes
Hi, Paul.

   I've done what you've told me. I've made some tests which led me into
thinking one thing, which I'd like you to correct me if I'm wrong and give
me some further explanations: when I select ROTATE_TO_SCREEN, it looks like
the image chosen as 'front' - the side displayed on the screen - is the one
seen from the z-axis. What I have to do is to rotate my shape initially so
that I have the side I want, looking at that direction. Is that right?

 Thanks,

  Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Dark Side of The Moon

2008-04-06 Thread Renan Mendes
Thanks, Paul, for everything.

Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Dark Side of The Moon

2008-04-05 Thread Renan Mendes
Hi,

   I'm trying to do a dark-side-of-the-moon effect (nothing to do with
Pink Floyd), i.e., I'm trying to have the same view of a certain object
independently of how my camera is oriented, never showing it's 'dark side'.
I thought of updating this object with some variation or component of my
view matrix, but I don't know exactly what it is. Can anyone shed some light
on this question?

 Thanks!

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Dark Side of The Moon

2008-04-05 Thread Renan Mendes
Hi, Paul.

 Thanks for the tip about the AutoTransform. I'm not being able though
to initialize the object I'm attaching to this node in the expected
position... It's a 3D mouse arrow, composed of a cone and a cylinder at the
bottom - very simple. When I do the following:

this-setPosition(osg::Vec3f(-3/sqrt(2.0)*ALTCONE/4, 0.0,
-3/sqrt(2.0)*ALTCONE/4));
this-setRotation(rot);  // rot is a certain quaternion

the arrow starts in the right position, when the camera is at its home
position (looking at the direction of the positive y-axis).

But when I add:

this-setAutoRotateMode(ROTATE_TO_SCREEN);

it's like the two other commands are ignored, and the arrow always appears
as being looked from the top.
What should I do?

Thanks again,

   Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] New Device Input

2008-04-03 Thread Renan Mendes
Hi,

 I'm working on a project that requires the use of a new input device,
called space navigator. I have the method that gets the 6 coordinates from
it. I'd like to know how to get it at every frame. I thought of using a
callback, but it doesn't seem right, for the object from that class is not
conceptually a osg::Node. Can I include it in my viewer.run() ?

 Thanks for your tip,

   Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] New Device Input

2008-04-03 Thread Renan Mendes
Thank you, all. Very good ideas. I'll check into what you've said.

Once again, thanks.


Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] New Device Input

2008-04-03 Thread Renan Mendes
Thanks for everyone's advice.

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Colors and Lighting

2008-03-28 Thread Renan Mendes
Hi,

I'm new at OSG and computer graphics in general, so I'd like to ask a
few very simple questions:
1) When I use an osg::Vec4 for setting the clear color, I have, of
course, 4 parameters. The first three are the proportion of red, green and
blue. But what does the last one do?
2) This question is linked to the last one, I think: how do I change the
intensity of the light in my scene?

Thank you,

   Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] LINE

2008-03-27 Thread Renan Mendes
Thank you all, for the help provided.

 Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Callbacks

2008-03-20 Thread Renan Mendes
Hi,

   I'm new in OSG and when I was reading about callbacks and how to
implement them, I couldn't understand one thing: for every different
callback you need a different class?

   Thanks,

 Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Assertion failure - using removeChild

2008-03-12 Thread Renan Mendes
Hi, everyone.

I wrote the following code:

case(osgGA::GUIEventAdapter::KEYDOWN):
{
if(ea.getKey() == ea.KEY_Delete)
{
if(!vprim.empty())
{
vprim_itr = vprim.begin();
while(vprim_itr != vprim.end())
{
if((*vprim_itr)-checkSelection()) // No
problems in this line
{
// HERE'S WHERE THE PROBLEM IS

root-removeChild(root-getChildIndex((*vprim_itr)), 1);
vprim_itr = vprim.erase(vprim_itr);
}

else
{
vprim_itr++;
}
}
}
}
}

where vprim is a STL vector and vprim_itr its iterator. When using the
combination of the two lines below the commentary in capitals, I get an
assertion failure that says: 'vector iterator not deferencable'. I don't
know if removeChild() has any particular property that would mess things up,
or if its just some subtle memory management aspect that I forgot to
consider... I would really appreciate if someone could give me an idea of
what's happening. Thanks.

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] get function in osg::Matrixf

2008-03-11 Thread Renan Mendes
Thanks, Gordon.

I'll keep that in mind when I manage to change OSG's code.

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] get function in osg::Matrixf

2008-03-09 Thread Renan Mendes
Hi,

 I'm new in using open source software. Because of that I don't know how
to modify the library's code according to my needs. For instance, I'd like
to create a getCoefficients() function in osg::Matrix, but I don't know
where to make that change. I'm using windows and I've followed the
installation step-by-step guide shown on OSG's website. Can anybody teach me
how to do it? Thanks.

 Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Saving and Loading Scenes

2008-03-08 Thread Renan Mendes
Hi,

I need some help on saving and loading scenegraphs. Reading the OSG
documentation, specifically the osgDB namespace, I saw that I have no idea
where to begin! Can someone give me a reference?

Thanks,

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Saving and Loading Scenes

2008-03-08 Thread Renan Mendes
Benjamin,

  I've used this function (it compiled alright), but when running my
aplication, there was an error message, saying that I didn't have the plugin
for reading and writing files...  I went to the OSG website and searched for
reading and writing plugins, but there were so many, I didn't know which one
to choose. Do you have a suggestion?

   Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] SpaceNavigator

2008-03-07 Thread Renan Mendes
Hi,

Has anyone used the 3Dconnexion SpaceNavigator in an OSG application?
I'm intending on using it as a mouse substitute (somehow create a mouse-like
cursor to be displayed), and use its 3D direction signals to rotate and
translate my shapes, and also my viewer.

I don't know where to begin, any information might be helpful.

   Thanks,

  Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] SpaceNavigator

2008-03-07 Thread Renan Mendes
OK, Mike. I'll have a look and come back with my questions.

Thanks,

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Transforms

2008-03-06 Thread Renan Mendes
Quick notation question:

When I have a MatrixTransform* mt and a Matrix m and I do this:
mt-postMult(m), which of the following am I mathematically doing?

mt = mt * m;

 or

mt = m * mt


Thanks,

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Stereoscopy, part 2

2008-02-24 Thread Renan Mendes
Thanks for your help. everyone. I haven't tested your suggestion yet, but
when I do (probably Tuesday), I'll let you know.

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Setting BoundingBox

2008-02-23 Thread Renan Mendes
Hi, Ulrich.

   This is what I've said in my first email:
   I am currently trying to implement 'snaps' in my application. I
don't know if that's the standard nomenclature, so I'll explain briefly what
I mean with that. A snap is basically a sudden transformation of the shape
on the screen to a certain orientation and position in space when it reaches
a certain state in the scene. For example, when a point gets close to a
plane, it gets translated to its projection on the plane [...]

   What I thought was that the function intersects() would give me a
'warning' when two shapes got close enough. That's what I've thought when I
decided to use BoundingBox. Is there a better way to do that?

Thanks for your help, Ulrich.

  Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Stereoscopy, part 2

2008-02-22 Thread Renan Mendes
Hi,

 It's been a couple of weeks since I first asked about stereoscopy in
OSG. I've had an answer from Rémy (which I forgot to thank for, sorry), but
I still have some questions on the subject.
 I've managed to use the stereoscopy option, which provided me with a
split image of my scene. When I finally tried to use the second video
monitor (I have a NVIDIA GeForce 6200 dual-head video card), something
unexpected happened. I have only managed to split the image between the two
monitors when I used the 800x600 resolution - and I had to drag the window
to the edge of the first video monitor for that to happen...
 What I wanted to know, is how to perform this action with the full
screen (1024x768). Any suggestions and tips are quite welcome...

 Thanks,

  Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Representing projections

2008-02-22 Thread Renan Mendes
Hi,

In my application, I need to represent simple shapes' projections. For
instance, project a line on a plane. I was thinking about using textures,
but my problem is that my projection will have to be to be rotated and
translated all the time, which, according to what I've noticed in some
examples, is not a very simple task. Another idea I've had was to use indeed
a light-and-shadow effect, but that wouldn't work either, for I need to
project that line on that plane even if some other shape comes in between
them.
Anyone has any suggestions?

   Thanks,

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Setting BoundingBox

2008-02-21 Thread Renan Mendes
Hi, everyone.

I am currently trying to implement 'snaps' in my application. I
don't know if that's the standard nomenclature, so I'll explain briefly what
I mean with that.
   A snap is basically a sudden transformation of the shape on the
screen to a certain orientation and position in space when it reaches a
certain state in the scene. For example, when a point gets close to a plane,
it gets translated to its projection on the plane, which is exactly what I'm
trying to do in my application. For that, I thought of using bounding boxes.
But to be able to control the minimum distance in which the bb's will
intersect, I must set their extensions. While trying to do that with the
function 'set', my compiler accused the following error:

   2 overloads have no legal conversion for 'this' pointer

   I'll paste the source code I am using:

osg::ShapeDrawable* drawable = new osg::ShapeDrawable(new osg::Box(posicao,
largura, comprimento, espessura)); // these are the same arguments of the
function
(drawable-getBound()).set(-COMPRIMENTO - 0.1, -LARGURA - 0.1, -ESPESSURA -
0.1,
 COMPRIMENTO + 0.1, LARGURA + 0.1,
ESPESSURA + 0.1); // constants in capital letters

Anyone could explain to me what's happening?

   Thanks for your help.

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] LineSegment and Plane Intersection

2008-02-18 Thread Renan Mendes
Hi, Robert.

   I am aware of the analytical way of solving my problems. Thanks,
anyway.

   Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] LineSegment and Plane Intersection

2008-02-17 Thread Renan Mendes
Hi, everyone.

I'm having some trouble with computing the coordinates of the intersection
between a osg::Plane and an osg::LineSegment. In addition, I'd like to be
able to compute only the intersection with the plane, and forget about the
rest of my scene... Is it possible?

Thanks,

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Stereoscopy in OSG

2008-02-12 Thread Renan Mendes
Hi, everyone.

  What is OSG's support on stereoscopy? I have a dual-head video
card and I needed that the images shown in the two monitors were slightly
different in terms of view angle (my final objective, of course, is to
project these two images on a screen making use of the stereoscopic
polarized projection technique). Does anyone have any reference on the
subject? Or even some already developed code? I'd really appreciate it.

  Thanks,

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Shape Intersection

2008-01-31 Thread Renan Mendes
Hi everyone,

  I need to detect when two shapes intersect and I need to know the
point (or set of points) where it happens. I'm using shape drawables and
I've been told that OSG doesn't have any support in that case. I was
suggested, then, to fit a polytope around my shapedrawables and compute the
intersections with that. Well, as you all know I'm new at computer graphics,
so, I'm going to ask simple questions to help me understand all this a
little bit better.
  As I've read in the doxygen documentation, a polytope is a volume
determined by a set of planes. My first question would be about how to
attach this polytope to my shapedrawable, being rotate and translated when
necessary.
  I've searched for an intersection method between polytopes within the
class but couldn't find any. Have I overlooked it?

  I'd be grateful if anyone could answer my questions, and if you have
any better solution to that (like stop using shapedrawables!), please tell
me.

   Thanks,

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] ShapeDrawables intersection

2008-01-24 Thread Renan Mendes
Hi, Robert.

 I think I really need a tutorial on intersections. How to compute them,
how to locate it in my world coordinates, etc. I don't really know what
Polytopes are, let alone deal with them... Could you give me a reference (or
several) on the subject?

Thanks,

  Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] ShapeDrawables intersection

2008-01-23 Thread Renan Mendes
Hi, everyone.


  I'd like to know a way to detect intersection between two
ShapeDrawables and its position.

   Thanks,

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Creating shapes under mouse cursor

2008-01-11 Thread Renan Mendes
Hi, Jean-Sébastien.

  Andreas told me that I needed to create a method to compute the
intersection of the line and plane. I was searching for a way reading the
doxygen documentation and expecting something similar to what I had done
with shapedrawable picking when I realised that neither lines nor planes are
nodes, let alone drawables. The code I used with picking (to select the
first visible drawable) was the following:

bool PickHandler::handle(const osgGA::GUIEventAdapter ea,
osgGA::GUIActionAdapter aa)
{
osgViewer::Viewer* viewer = dynamic_castosgViewer::Viewer*( aa );
osgUtil::LineSegmentIntersector::Intersections intersections;

if(!viewer)
{ return false; }

switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::RELEASE):
{
if(Intersecao(viewer, ea, intersections))  // a method that
called computeIntersections with the right parameters
{
osgUtil::LineSegmentIntersector::Intersections::iterator
hitr = intersections.begin();

if(hitr-drawable.valid())
{
  .
}
}

  I was thinking of doing the same with the plane, but since it isn't a
drawable, I don't know what to do. I mean, what is a plane according to OSG
? I can't add it to a root node, for instance, to be shown on screen, so
what is it? Sorry Lots of basic questions that I need to understand
before creating that method...

  Thanks,

   Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] decompose and osg::Quat

2008-01-08 Thread Renan Mendes
Hi, Jean-Sébastien.

Thanks for the interest, I'll check into that link you gave me.

 Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Creating shapes under mouse cursor

2008-01-08 Thread Renan Mendes
   Hi, Andreas


   here a bit of code, which you will have to adjust to your setup (meaning

 that I use a GUI and you use a Viewer, where Functions for retrieving
 the mouse are different):



//

//Here you get the mouse, you will have to do this differently
 int lastx = event.GetX();
 int lasty = event.GetY();
 //Here you get the size of your viewport, you will have to do this
 differently:
 int w=0; int h=0; GetSize(w, h);
 //Here I normalize the mouse to floats between -1 and 1
 float x = -1.0f + (float)(2*(lastx))/(float)w;
 float y = -1.0f + (float)(2*(h -lasty))/(float)h;



/***/

   I've substituted the above with float x = ea.getXNormalized();, I've
figured it would be the same.

/**/

//You will have to do this slightly differently, using the
 corresponding functions of your viewer:
 osg::Matrix pm = sceneView-getProjectionMatrix();
 osg::Matrix vm = sceneView-getViewMatrix();


 /*/


About the your commentary right above: I've searched thoroughly in
the doxygen documentation and I haven't found any method equivalent to
getProjectionMatrix, in osgUtil::SceneView, in osgViewer::Viewer. Is there a
way to transfer the data from the viewer to SceneView and then use
getProjectionMAtrix(). For example getting scene data from the same root
node?

Thanks,

  Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Creating shapes under mouse cursor

2008-01-07 Thread Renan Mendes
 Hi Renan,

 what I do for this is the following:

 - compute the line behind the mouse cursor perpendicular to the screen.
 You will ned the transformation and view matrices for this

 - intersect this line with a plane parallel to the screen through the
 origin. You can use the line computed before as a normal vector for this
 plane

 The intersection gives a point that is
 a) behind the mouse
 b) as close to the origin as possible

 The choice for the depth might be another, but this one makes sense in
 some way!

 Regards,

 Andreas



Hi, Andreas.

Sorry I took so long to reply. I still haven't tried your method,
but that's because I didn't understand it right away. I'll read a little bit
more of the documentation to see the classes and methods that I need, and
when I do it, I'll let you know.

 Thanks,

  Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] decompose and osg::Quat

2008-01-07 Thread Renan Mendes
Hi, everyone.

 I've got a simple question that I'm sure everyone will be able to
answer. When I have a matrix and use it in matrix.decompose (osg::Vec3
translation, osg::Quat rotation, osg::Vec3 scale, osg::Quat so), my
second argument will be filled with numbers that are supposed to represent
the rotation. But what exactly these four numbers relate to the rotation
matrix? More specifically, how do they relate to the arguments of the
constructor osg::Quat(angle1, axis1, angle2, axis2, angle3, axis3).

 Thanks,

 Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Creating shapes under mouse cursor

2008-01-06 Thread Renan Mendes
Hi everyone.

  In my application, when I press the 'p' key, when no shape is
selected, I create a small ShapeDrawable sphere and add it to the root node.
I'd like to be able to create that shape right under the mouse cursor. I've
tried using the coordinates from ea.getX() and ea.getY(), but they are not
the same as my world coordinates. Which is logically fine, since they can't
coincide when my view is rotated from the original position. Is there a way
to perform this action?

   Thanks,

   Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Mathematical foundations

2008-01-06 Thread Renan Mendes
Hi everyone,

 Since I'm new on the whole computer graphics world, I don't have the
mathematical foundations needed to fully comprehend the geometric
transformations involved in a scene graph and used by OSG in its methods.
I'd like to ask anybody who knows about a good website that deals with this
kind of subject. Thanks in advance.

 Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Bizarre crash

2008-01-04 Thread Renan Mendes
Hi,

The most bizarre happened in my application during tests. When I open
the prompt window to check some printed data, the program crashes and
Windows closes it automatically. The most weird thing is that when I don't
select the prompt window on the task bar, my application runs perfectly. But
if I do the same actions and select the prompt window on the task bar, the
program stops working...

Any ideas?

   Thanks,

 Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Bizarre crash

2008-01-04 Thread Renan Mendes
No need. Solved.

   Thanks,

 Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Error: 'Debug Assertion Failure!'

2008-01-03 Thread Renan Mendes
Hi, Gordon.

  I've looked up the doxygen documentation, and the second argument of
removeChild is numChildrenToRemove, which I thought stood for 'number of
children to remove'. If so, wouldn't I want 1 child to be removed? Isn't my
index correct?

 Thanks,

 Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Error: 'Debug Assertion Failure!'

2008-01-03 Thread Renan Mendes
Hi, Rafa,

I've tried doing something like what you've said before: every time
before I checked for selections with verifySelection(), I searched for a
NULL member and erased it, like it's done below. Can you tell me why it
still isn't working? Is there a logical flaw in my code?

   Thanks,
   Renan M Z Mendes

case(osgGA::GUIEventAdapter::KEYDOWN):
{
if(!ponto.empty())
{
for(ponto_limp = ponto.begin(); ponto_limp != ponto.end();
ponto_limp++)
{
if(*ponto_limp == NULL)
{
ponto.erase(ponto_limp);
}
}

for(ponto_itr = ponto.begin(); ponto_itr != ponto.end();
ponto_itr++)
{
if((*ponto_itr)-verifySelection())
{
switch(ea.getKey())
{
case(ea.KEY_Delete):
{
osg::Group* root =
(*ponto_itr)-getParent(0);

root-removeChild(root-getChildIndex((*ponto_itr)), 1);
}
}
}
}
}
   }
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Error: 'Debug Assertion Failure!'

2008-01-02 Thread Renan Mendes
Hi, everyone.

  When testing my application, an error message appeared saying: 'Debug
Assertion Failure' and 'vector subscription out of range'. This error
occured when:

1) I wrote the following code:

case(osgGA::GUIEventAdapter::KEYDOWN):
{
if(!ponto.empty()) // ponto is defined as:
std::vectorPonto* ponto; in which Ponto is a class created by me.
{
for(ponto_itr = ponto.begin(); ponto_itr != ponto.end();
ponto_itr++)
{
if((*ponto_itr)-verifySelection()) // verifies if
the shape associated with an instance of the class Ponto was picked
{
switch(ea.getKey())
{
case(ea.KEY_Delete):
{
osg::Group* root =
(*ponto_itr)-getParent(0);

root-removeChild(root-getChildIndex((*ponto_itr)), 1);
}
}
}
}
}


2) AND when I do the following:
  1 - select one point;
  2 - delete it;
  3 - press delete again, having or NOT selected another 'ponto'
(instance of class Ponto) on the screen.

NOTE: when a drawable from 'ponto' is selected (picked), the 'ponto' is
allocated in the vector.


  Thanks,

  Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] STL vectors and function calls

2007-12-29 Thread Renan Mendes
Hi, everyone.

I've got  quick question on STL vectors.

I've created a class (let's call it MyClass) with the method 'bool
MyMethod(std::vectorMyClass MyVector)' that calls another method 'void
AnotherMethod()' that makes a simple check on a variable inherent to every
instance of MyClass.


How do I write that method? Or better put: how do I change the following
code to make it right?

bool MyClass::MyMethod(std::vectorMyClass MyVector)
{
  std::vectorMyClass::iterator MyIterator;

  for(MyIterator = MyVector.begin(); MyIterator != MyVector.end();
MyIterator++)
 {
*MyIterator-AnotherMethod();
 }
}

I read that an iterator was a pointer to the content of the vector, why
doesn't it work?


Thanks,


Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] STL vectors and function calls

2007-12-29 Thread Renan Mendes
Thanks, Gordon.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Path from ShapeDrawable to Parents above...

2007-12-24 Thread Renan Mendes
Hello, everyone.

In my application, I use ShapeDrawables, which are selected by the user
by mouse picking. An extract of the code concerning the picking is as
follows:

bool PickHandler::handle(const osgGA::GUIEventAdapter ea,
osgGA::GUIActionAdapter aa)
{
osgViewer::Viewer* viewer = dynamic_castosgViewer::Viewer*( aa );
osgUtil::LineSegmentIntersector::Intersections intersections;


if(!viewer)
{ return false; }

switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::PUSH):
{
if(Intersecao(viewer, ea, intersections))
{
osg::notify(osg::NOTICE) Selecao de ;
osgUtil::LineSegmentIntersector::Intersections::iterator
hitr = intersections.begin();

if(hitr-drawable.valid())
{
osg::ShapeDrawable* shapedrawable =
dynamic_castosg::ShapeDrawable*(hitr-drawable.get());
changeColor(shapedrawable);
std::string nome = shapedrawable-getName();
}

}
}
}
}

bool PickHandler::Intersecao(osgViewer::Viewer* viewer, const
osgGA::GUIEventAdapter ea,
 osgUtil::LineSegmentIntersector::Intersections
intersections)
{
return (viewer-computeIntersections(ea.getX(),ea.getY
(),intersections));
}


   I've looked through the doxygen documentation but couldn't find
any method that would return the drawable where the shapedrawable is
attached to. This way I would be able to get to the parent that has all the
information I need. Let me give an example to simplify.
  I have selected a sphere on the screen that is the drawable (in
the form of a shapedrawable) of an instace of the class Sphere (not the
osg's). How do I access the data that is inherent to every intance of that
class? A ShapeDrawable is not a Node, so I can't get a Parent... How do I do
it?

Thanks,

 Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Traversing

2007-12-21 Thread Renan Mendes
Hi, Jean-Sébastien.

OK, I've had some trouble with the first bug, but the second one
I've corrected. I've sent you two messages. The last one got rid that !
problem. I was just testing the program in various manners to see where was
the mistake.
About the first error: I was told that the 'intersections' was an
array, so that's why I have used it in the function call as it is. Once
again, thanks for your help.

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Traversing

2007-12-21 Thread Renan Mendes
Hi, Jean-Sébastien.

  I agree with you on the read more the provided documentation part.
My last message was just so you knew I'm not completely idiot on the
subject, although I recognise I need a lot of learning to do. Well, I thank
you for this good lesson you've given me on picking.

   Bonnes fêtes,

  Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Traversing

2007-12-20 Thread Renan Mendes
Hi, Jean-Sébastien.

   When you've given me that code I've rearranged it in a way that would
be more intuitive to me and it turned out to be this one below. Nothing much
really. Just some methods calls,... well, see for yourself - nothing really
changed. But I'm worried about something, since it didn't work. I've
realized that the 'for' marked in the code is a little bit strange for what
I want to happen.
   As I recall, it was used as it is to keep showing the coordinates of
the point you were on with the mouse cursor, in the osgpick example. Is it
appropriate in my case? I just want the color to change when I push the left
button...
   Thanks again,

 Renan M Z Mendes


bool PickHandler::handle(const osgGA::GUIEventAdapter ea,
osgGA::GUIActionAdapter aa)
{
osgViewer::Viewer* viewer = dynamic_castosgViewer::Viewer*( aa );
osgUtil::LineSegmentIntersector::Intersections intersections;


if(!viewer)
{ return false; }

switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::PUSH):
{
if(Intersecao(viewer, ea, intersections))
{
osg::notify(osg::NOTICE) SELECAO  std::endl;

for(osgUtil::LineSegmentIntersector::Intersections::iterator hitr =
intersections.begin(); hitr != intersections.end();
++hitr) // I'M TALKING ABOUT THIS ONE
{
if(hitr-drawable.valid())
{
osg::ShapeDrawable* shapedrawable =
dynamic_castosg::ShapeDrawable*(hitr-drawable.get());
shapedrawable-setColor(osg::Vec4(1.0, 0.0, 0.0,
1.0));
}
}
}
}
}
}

bool PickHandler::Intersecao(osgViewer::Viewer* viewer, const
osgGA::GUIEventAdapter ea,
 osgUtil::LineSegmentIntersector::Intersections
intersections)
{
return (viewer-computeIntersections(ea.getX(),ea.getY
(),intersections));
}
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Traversing

2007-12-20 Thread Renan Mendes

 The for loop you point to is actually because the intersection test

might return multiple results (objects behind one another, for
 example). In your case, you probably just want the closest
 intersection. Check the documentation for the
 osgUtil::LineSegmentIntersector::Intersection structure to find out
 how to get that.


Well, I have tried running my application with only a shape drawable
sphere, and nothing else. But even so, it didn't work.

I've put an osg::notify(osg::NOTICE) inside the 'for' nest and outside
the if(drawable.valid()) nest and I saw that it never entered the 'for'...
Just in case you've erased my previous messages, I'm copying the new code
with the appear-if-worked messages (that didn't appear).

Thanks

   Renan Mendes

bool PickHandler::handle(const osgGA::GUIEventAdapter ea,
osgGA::GUIActionAdapter aa)
{
osgViewer::Viewer* viewer = dynamic_castosgViewer::Viewer*( aa );
osgUtil::LineSegmentIntersector::Intersections intersections;


if(!viewer)
{ return false; }

switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::PUSH):
{
if(Intersecao(viewer, ea, intersections))
{
osg::notify(osg::NOTICE) SELECAO  std::endl;

for(osgUtil::LineSegmentIntersector::Intersections::iterator hitr =
intersections.begin(); hitr != intersections.end();
++hitr)
{
osg::notify(osg::NOTICE) ENTERED THE FOR 
std::endl;
if(!hitr-drawable.valid())
{
osg::notify(osg::NOTICE) ENTERED HERE 
std::endl;
osg::ShapeDrawable* shapedrawable =
dynamic_castosg::ShapeDrawable*(hitr-drawable.get());
shapedrawable-setColor(osg::Vec4(1.0, 0.0, 0.0,
1.0));
}
}
}
}
}
}

bool PickHandler::Intersecao(osgViewer::Viewer* viewer, const
osgGA::GUIEventAdapter ea,
 osgUtil::LineSegmentIntersector::Intersections
intersections)
{
return (viewer-computeIntersections(ea.getX(),ea.getY
(),intersections));
}
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Traversing

2007-12-18 Thread Renan Mendes
Hi, Robert.

I'm sorry, Robert, but would you mind explaining a little bit more on how do
I get access to this list? And from this, how do I choose specifically the
Drawable leaf?

Thanks,

Renan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Traversing

2007-12-18 Thread Renan Mendes
Hello, Jean-Sébastien.

   Although it didn't seem so, I have looked through the doxygen
documentation. The thing is that they aren't good enough for someone who
hasn't any experience what so ever with this kind of programming. Some of
the methods aren't fully explained, at least to my understanding, and even
if they were, is kind of weird reading that whole documentation without
knowing what you are looking for. This last part, I believe, is the function
of a tutorial or something alike. For instance, I didn't know that an
intersection was made directly with the Drawable, even though my instance
connected to the viewer is a MatrixTransform...
  But I think now I can at least use the Intersections properly, even if
I don't fully understand it.
  I thank you and Robert for the help.

   Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Traversing

2007-12-18 Thread Renan Mendes
Hi, Jean-Sébastien.

 I'm gonna take advantage of the fact you are there and ask you one
thing. I tried using that last part of code you've given me, but my compiler
acused an error:

1.\Classe Pick Handler.cpp(23) : error C2682: cannot use 'dynamic_cast' to
convert from 'osg::ref_ptrT' to 'osg::ShapeDrawable *'
1with
1[
1T=osg::Drawable
1]


given that the line where the error ocurred was:
osg::ShapeDrawable* shapedrawable =
dynamic_castosg::ShapeDrawable*(hitr-drawable);

Can you tell me what's wrong?

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Traversing

2007-12-18 Thread Renan Mendes
Hey, don`t you ever worry about it! I'm lucky enough you do answer my
questions.

Thanks again,

Renan M Z Mendes
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


  1   2   >