Re: [osg-users] Texturing

2009-04-27 Thread Ümit Uzun
Hi Yafes;

Have you looked at OSG tutorials? If not, you should really examine much of
them (http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials).
You will grasp how could be used texturing and so on.

And your texture coordinates looks wrong because you should trace the line
while defining it. Don't jump one direction to other.

Regards.

2009/4/28 Yafes 

> Hi @ all,
>
> as you maybe know fro my previous posts, i was tryieng to build some
> stairs, which i already did.
>
> Know the attached files show the vertex Points and the faces, how they are
> arranged. I would like to put a texture on it, so that i use just one
> "texture.jpg" which is a line and should cover the whole object.
>
> 1) First of all, i just took the first two faces to give a try. Is this the
> correct way how my texture coordinates should look like?
>
>// texture coordinates
>osg::Vec2Array *stairCoor = new osg::Vec2Array();
>stairCoor->push_back(Vec2(0.0, 0.0));
>stairCoor->push_back(Vec2(0.0, 1.0));
>stairCoor->push_back(Vec2(1.0, 0.0));
>stairCoor->push_back(Vec2(1.0, 1.0));
>stairCoor->push_back(Vec2(0.0, 0.0));
>stairCoor->push_back(Vec2(0.0, 1.0));
>stairCoor->push_back(Vec2(1.0, 0.0));
>stairCoor->push_back(Vec2(1.0, 1.0));
>
> 2) As mentioned in my intro, i was looking for a way, how i could place a
> texture over many faces, so that i use just one image for the whole object.
>
>
> Thank you very much!
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=10944#10944
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


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


[osg-users] Texturing

2009-04-27 Thread Yafes
Hi @ all, 

as you maybe know fro my previous posts, i was tryieng to build some stairs, 
which i already did. 

Know the attached files show the vertex Points and the faces, how they are 
arranged. I would like to put a texture on it, so that i use just one 
"texture.jpg" which is a line and should cover the whole object. 

1) First of all, i just took the first two faces to give a try. Is this the 
correct way how my texture coordinates should look like?

// texture coordinates
osg::Vec2Array *stairCoor = new osg::Vec2Array();
stairCoor->push_back(Vec2(0.0, 0.0));
stairCoor->push_back(Vec2(0.0, 1.0));
stairCoor->push_back(Vec2(1.0, 0.0));
stairCoor->push_back(Vec2(1.0, 1.0));
stairCoor->push_back(Vec2(0.0, 0.0));
stairCoor->push_back(Vec2(0.0, 1.0));
stairCoor->push_back(Vec2(1.0, 0.0));
stairCoor->push_back(Vec2(1.0, 1.0));

2) As mentioned in my intro, i was looking for a way, how i could place a 
texture over many faces, so that i use just one image for the whole object.


Thank you very much!

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10944#10944



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


Re: [osg-users] Using osgWidget Only On one display In Multiple Display Setup

2009-04-27 Thread Roland Smeenk
See the FAQ
http://www.openscenegraph.org/projects/osg/wiki/Support/FAQ

See the answer to question:


> I have two or more views sharing a scene graph, but I want to limit what part 
> of the scene graph is shown in one or more of the views. How do I do that? 
> 


--
Roland

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10943#10943





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


[osg-users] [build] error: add_dependencies Adding dependency to non-existent target

2009-04-27 Thread Abhinav Dubey
Hi,
i am trying o add dependency but when i do that it gives add_dependencies 
Adding dependency to non-existent target:pluginTest
I am using:
add_dependencies(pluginTest N3DApp)

plz help!!
 :? ... 

Thank you.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10942#10942





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


[osg-users] osgEphemeris skyDome issue

2009-04-27 Thread Paul Pocock
Sorry for posting this here on osg-users, the osgEphemeris List is 
rather quiet.

My understanding was that the skyDome centre would always be the camera 
eye point - however
having tried  setSkyDomeCenter at init and calling it every frame the 
user can still traverse outside the skydome.
Perhaps this is normal behaviour?

Trying to set the skyDomeRadius to some massive figure just introduces 
culling problems.

Has anyone else has had this problem?

Best Regards
Paul

















IMPORTANT: This email remains the property of the Australian Defence 
Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 
1914.  If you have received this email in error, you are requested to contact 
the sender and delete the email.

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


[osg-users] Multiple Shaders Performance Question

2009-04-27 Thread paul1492

I have multiple shaders. I attach one shader to the root of the scene graph. I 
then load in objects and attach one of another set of shaders to the root of 
the object and attach it to the main scene graph. When I say "attach a shader", 
I'm loading a fragment and vertex shader from a file and attaching them to a 
new Program object each time. I then attach the Program object to the object's 
state set.

Is there any performance advantage to doing it this way or creating one Program 
object for each shader and attach these same Program object to my objects. Or 
should I be creating a set of StateSet's and attaching the appropriate StateSet 
to my object based on the Shader I want to use.

To complicate things, I have multiple cameras used to render to multiple Frame 
Buffer Objects.

What I'm seeing is a (single) missed frame when an object with a "new" shader 
appears in the Field of View (running at 120Hz)?

Could OSG be attempting to "recompile" my shader? Is driver downloading the 
shader each time to the video card.

Paul P.


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


[osg-users] Shaders on Slave Cameras

2009-04-27 Thread Brian R Hill
Folks,

I want to render slave cameras with different shaders. It doesn't seem to
work (osg 2.2). They are all rendered the same way as the main camera.

Can I do this?

Brian

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


Re: [osg-users] PagedLOD

2009-04-27 Thread Thrall, Bryan
Alan Ott wrote on Monday, April 27, 2009 4:40 PM:
> I'm using PagedLOD to load terrain tiles off disk. The problem I have
is
> that before I want the tile to actually render, I want to do a setup
of
> the tile (to look up certain control nodes and set switches according
to
> the current state of the system (eg: day/night mode, etc)).
> 
> So on my own update(), I check to see if each PagedLOD has just
loaded,
> and if it has, I run the initialization on it. The problem is, when a
> tile gets loaded, it is rendered for one frame _before_ I can do my
> initialization on it. So for one frame, it is drawn wrong, then the
next
> frame, it is drawn right.
> 
> I thought I might be able to get around this by setting the Node Mask
to
> 0 until it was initialized, but that seems to just keep the tiles from
> getting loaded entirely (because the update traverser isn't getting
into
> the PagedLOD either).
> 
> Do any of you have any ideas of what I could try to do to get around
> this? Is there some value of the NodeMask that I could use to enable
> update but not draw? Such a value did not seem to be documented in the
API.

Have you considered a ReadFileCallback (see osgDB::Registry)?


-- 
Bryan Thrall
FlightSafety International
bryan.thr...@flightsafety.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] PagedLOD

2009-04-27 Thread Alan Ott

Hello,

I'm using PagedLOD to load terrain tiles off disk. The problem I have is 
that before I want the tile to actually render, I want to do a setup of 
the tile (to look up certain control nodes and set switches according to 
the current state of the system (eg: day/night mode, etc)).


So on my own update(), I check to see if each PagedLOD has just loaded, 
and if it has, I run the initialization on it. The problem is, when a 
tile gets loaded, it is rendered for one frame _before_ I can do my 
initialization on it. So for one frame, it is drawn wrong, then the next 
frame, it is drawn right.


I thought I might be able to get around this by setting the Node Mask to 
0 until it was initialized, but that seems to just keep the tiles from 
getting loaded entirely (because the update traverser isn't getting into 
the PagedLOD either).


Do any of you have any ideas of what I could try to do to get around 
this? Is there some value of the NodeMask that I could use to enable 
update but not draw? Such a value did not seem to be documented in the API.


Thanks for all your help,

Alan.


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


[osg-users] Using osgWidget Only On one display In Multiple Display Setup

2009-04-27 Thread Rahul Jain

Hi All,
I am running my application on multiple displays (0.0 & 0.1). I am using 
two slave  cameras for rendering on to both the displays. The GUI of the 
application is written using osgWidget. When I run my application the 
same menu is replicated on both the displays. Is it possible to render 
the GUI only on One display say 0.0 ?


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


[osg-users] Point matching / Affine transforms

2009-04-27 Thread Martin Beckett
I need to align two data sets in OSG by fitting a small number of key points 
and calculating the translation/rotation matrices.

Normally this is done with a Helmert transform, that defines 7 parameters (xyz 
translate, xyz rotate, linear scale) to convert between map coordinates.  
GDAL seems to use Affine transforms instead - it has routine to apply 
transforms but I can't find anything to calculate them.

First has anyone else already done this?
Second - since it's going to involve pulling in a lot of Least-Squares/SVD or 
other solver code is there a preferred numerical library?

Martin

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10933#10933





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


Re: [osg-users] The normal of my screen

2009-04-27 Thread Jean-Sébastien Guay

Hi Mangu,


If the the center is what I look at, so basically it's the normal of the plane 
( described by the screen) isn't it??


Both eye and center are points, not vectors. So center can't be the 
normal of the screen's plane... (center - eye).normalize() is.


J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] The normal of my screen

2009-04-27 Thread Mangu Liok
Thank you, I miss-calculated the normal so I wasn't sure about it. now it 
works. I tried some croos product but a simple  'center - eye' did the work. 
thank you Robert.

If the the center is what I look at, so basically it's the normal of the plane 
( described by the screen) isn't it??

Mangu

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10932#10932





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


Re: [osg-users] Public ffmpeg plugin testing streams

2009-04-27 Thread Jean-Sébastien Guay

Hello Tanguy,


FFmpegDecoder.cpp :
 -> bool FFmpegDecoder::readNextPacketNormal() [Line 246 to 308]
 -> bool FFmpegDecoder::readNextPacketEndOfStream() [Line 312 to 320]

More precisely, I wonder about the API validity of the following code in the 
case of a streaming video. FFmpeg documentation is quite poor in this regard.

// Read the next frame packet
if (av_read_frame(m_format_context.get(), &packet) < 0)
{
if (url_ferror(m_format_context->pb) == 0)
end_of_stream = true;
else
throw std::runtime_error("av_read_frame() failed");
}


Actually, even after the video stops updating, it never goes into that 
if(), and instead it looks like it continues going into the valid read 
cases:


else if (m_pending_packet.packet.stream_index == m_video_index)
{
if (m_video_queue.timedPush(m_pending_packet, 10)) {
m_pending_packet.release();
return true;
}
}

(~line 293 of FFmpegDecoder.cpp)

But by going to http://iris.cm-labs.com:10080/img/video.mjpeg we can 
verify that the video continues...


What happens to the packet after it's pushed into m_video_queue? Who 
reads it?


Any other ideas? Or any chance you could have a look at that code with 
the current plugin in SVN? (osgmovie -e ffmpeg 
http://iris.cm-labs.com:10080/img/video.mjpeg)


Thanks in advance,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] using AABB instead of bounding sphere for intersection tests?

2009-04-27 Thread Chris 'Xenon' Hanson
Peter Amstutz wrote:
> Is there a way to use an axis-aligned bounding box (AABB) for the coarse
> bounding volume rather bounding spheres, for line segment
> intersections?  In my application my primary geometry is made up of
> terrain tiles which are naturally axis aligned and buildings which tend
> to be rectangular prisms.  In both cases, my intuition is that even the
> worst-case AABB is still going to represent a much tighter bound than
> the best-case bounding sphere, leading to unnecessary and expensive
> tests against the actual geometry.  It's not clear that simply
> reorganizing and optimizing the scene graph would help much in this
> case, since the buildings are clustered in a town such that bounding
> spheres will naturally tend to overlap, as well as extend out into the
> street.  Any ideas on how to handle this situation more efficiently?

  I think the reason for the bounding spheres is that it is a very 
efficient-to-compute
formula -- many times more efficient than AABB.

  Are you worried about intersection efficiency during cull phase, or during 
intersection
testing, or where? Have you actually experienced a measurable problem or are you
speculating that there will perhaps be one?

> Thanks,
> - Peter

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"There is no Truth. There is only Perception. To Perceive is to Exist." - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] using AABB instead of bounding sphere for intersection tests?

2009-04-27 Thread Jean-Sébastien Guay

Hello Peter,

In both cases, my intuition is that even the 
worst-case AABB is still going to represent a much tighter bound than 
the best-case bounding sphere, leading to unnecessary and expensive 
tests against the actual geometry.


Actually, the osg::Node hierarchy uses bounding spheres, but the 
osg::Drawable hierarchy uses AABBs. Once an intersection returns a 
success against the BS, it will go down to the osg::Geodes, then loop 
through the geode's drawables, checking their AABBs for intersection as 
well. Only once one or more of these returns a success will it test 
geometry.


See src/osgUtil/LineSegmentIntersector.cpp, method 
intersect(IntersectionVisitor&, Drawable*):


void LineSegmentIntersector::intersect(osgUtil::IntersectionVisitor& iv,
   osg::Drawable* drawable)
{
osg::Vec3d s(_start), e(_end);
if ( !intersectAndClip( s, e, drawable->getBound() ) ) return;
// ...

Here, intersectAndClip() checks the drawable's bounding box for 
intersections and returns false if there were none.


So your intuition is right, but OSG already does this. You're welcome to 
go down into the intersection visitor / line segment intersector and 
improve upon this, of course.


J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] osgdb_freetype build problem on Mac OS/X 10.5.6

2009-04-27 Thread Jaeyoung Haan
Thanks robertosfield, it works.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10925#10925





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


[osg-users] using AABB instead of bounding sphere for intersection tests?

2009-04-27 Thread Peter Amstutz
Is there a way to use an axis-aligned bounding box (AABB) for the coarse 
bounding volume rather bounding spheres, for line segment 
intersections?  In my application my primary geometry is made up of 
terrain tiles which are naturally axis aligned and buildings which tend 
to be rectangular prisms.  In both cases, my intuition is that even the 
worst-case AABB is still going to represent a much tighter bound than 
the best-case bounding sphere, leading to unnecessary and expensive 
tests against the actual geometry.  It's not clear that simply 
reorganizing and optimizing the scene graph would help much in this 
case, since the buildings are clustered in a town such that bounding 
spheres will naturally tend to overlap, as well as extend out into the 
street.  Any ideas on how to handle this situation more efficiently?


Thanks,
- Peter

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


Re: [osg-users] 'setGLExtensionsFuncPtr': identifier not found

2009-04-27 Thread Jean-Sébastien Guay

Hi Robert,


Sorry about this.  Trying to fix Windows build warnings reported on
CDash remotely and without the ability to directly test... looks like
I made typo in the function name.   I've now fixed this typo,
hopefully it'll now work.  Could you do an svn update?


Yep, that did it, thanks.

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] 'setGLExtensionsFuncPtr': identifier not found

2009-04-27 Thread Robert Osfield
Hi J-S,

Sorry about this.  Trying to fix Windows build warnings reported on
CDash remotely and without the ability to directly test... looks like
I made typo in the function name.   I've now fixed this typo,
hopefully it'll now work.  Could you do an svn update?

Robert.

On Mon, Apr 27, 2009 at 5:11 PM, Jean-Sébastien Guay
 wrote:
> Hi Robert,
>
> Your checkin to src/osg/GLExtensions.cpp today is missing something I guess,
> because I'm getting the following errors trying to compile:
>
> 1>..\..\..\src\osg\GLExtensions.cpp(115) : error C3861:
> 'setGLExtensionsFuncPtr': identifier not found
> 1>..\..\..\src\osg\GLExtensions.cpp(119) : error C3861:
> 'setGLExtensionsFuncPtr': identifier not found
>
> Perhaps there's a file missing from the commit?
>
> Thanks,
>
> J-S
> --
> __
> Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
>                               http://www.cm-labs.com/
>                        http://whitestar02.webhop.org/
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] 'setGLExtensionsFuncPtr': identifier not found

2009-04-27 Thread Jean-Sébastien Guay

Hi Robert,

Your checkin to src/osg/GLExtensions.cpp today is missing something I 
guess, because I'm getting the following errors trying to compile:


1>..\..\..\src\osg\GLExtensions.cpp(115) : error C3861: 
'setGLExtensionsFuncPtr': identifier not found
1>..\..\..\src\osg\GLExtensions.cpp(119) : error C3861: 
'setGLExtensionsFuncPtr': identifier not found


Perhaps there's a file missing from the commit?

Thanks,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] determine record type from OpenFlight files?

2009-04-27 Thread Robert Osfield
On Mon, Apr 27, 2009 at 4:08 PM, Paul Martz  wrote:
> Using a keyword in the description string would allow the exporter to filter
> these strings out before writing Comment records. Great idea.
>
> Back when I first started using OSG, I suggested replacing the current
> UserData and DescriptionList mechanisms with some type of key-value std::map
> based scheme. We had already been using such a scheme in our app at my
> former employer. Robert didn't like the idea, but I don't remember the
> details. Seems like such a scheme would allow multiple UserData per object,
> which would be nice. On the other hand, it does require that operator<() be
> declared for any object stored in the map, which can be a pain to have to
> define.

My objection will have been down to flexibility and memory footprint
(maps take more memory than a single pointer).

You can always implement your own custom scheme for UserData that can
use a std::map<> as required.  The OpenFlight plugin could implement
such a custom UserData and place it in osgSim alongside the other
OpenFlight specific structures.

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


Re: [osg-users] setCursor problem

2009-04-27 Thread Frederic Bouvier
Hi Romain,

if you followed the thread I initiated on osg-submissions list, you'd realize 
that the current code can only show the left arrow.
So in other words, don't change your code, and apply the patches I submitted.

I am sure Robert will take care of this soon.

Regards,
-Fred


- "Romain Charbit" a écrit :

> Hi,
> 
> I've seen some discussions about the mouse cursor, but it doesn't
> answer my question. 
> 
> How can I set a cursor with the function setCursor. When I make a
> setCursor :
> 
> 
> Code:
> 
> osgViewer::GraphicsWindow::MouseCursor mouseCursor;
> mouseCursor = osgViewer::GraphicsWindow::DestroyCursor;
> gw->setCursor(mouseCursor);
> 
> 
> 
> 
>  it does absolutely nothing. 
> 
> The only way I can have a cursor, is to do :
> 
> 
> Code:
> 
> while(!viewer.done())
> {
> viewer.frame();
>   gw->setCursor(mouseCursor);
> }
> 
> 
> 
> 
> And it does not a proper set, it sets the new cursor only when the
> mouse is not moving.
> 
> I watched the source code, and I find it a bit confusing : 
> 
> osgViewer/GraphicsWindowWin32.cpp
> 
> GraphicsWindowWin32::setCursor( MouseCursor mouseCursor )
> 
> 
> Code:
> 
> if (mouseCursor != LeftRightCursor && 
> mouseCursor != UpDownCursor && 
> mouseCursor != TopLeftCorner && 
> mouseCursor != TopRightCorner && 
> mouseCursor != BottomLeftCorner && 
> mouseCursor != BottomRightCorner)
> {
> _appMouseCursor = mouseCursor;
> }
> 
> 
> 
> 
> then :
> 
> Code:
> 
> case WM_NCHITTEST :
> 
> ...
> ...
> 
> default:
>   if (_traits->useCursor && _appMouseCursor != InheritCursor)
>setCursor(LeftArrowCursor);
>   break;
> 
> 
> 
> 
> 
> 
> so if I set a cursor, _appMouseCursor will be equal to the new cursor,
> but will be erased by the case WM_NCHITTEST;
> 
> Is there something I'm missing?
> 
> Thank you.
> 
> Romain.
> 
> 
> Romain Charbit
> 
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=10917#10917
> 
> 
> 
> 
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OpenSceneGraph-2.8.1 release candidate three tagged

2009-04-27 Thread Andy Skinner
RC3 seems OK to me on Win32, linux 64, and Intel mac 32.

thanks,
andy

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Thursday, April 23, 2009 10:41 AM
To: OpenSceneGraph Users
Subject: [osg-users] OpenSceneGraph-2.8.1 release candidate three tagged

Hi All,

(from my blog at blog.openscenegraph.org)

I've just tagged the 2.8.1 release candidate 3. The are a couple of
fixes since rc2:

* Fix to the subsurface handling in OpenFlight files
* Removal of an old hack to PolygonOffset's unit multiplier for
ATI cards that is no longer required.
* A couple of typo/spelling fixes.
* Build fix for collada under OSX.
* Addition of GL_RGB8 support to osg::image::computeNumComponts()
* Fix to DatabasePager to prevent a crash that occurred when apps
that did't set the active contexts (note, osgViewer automatically sets
the active contexts so was unaffected by this bug.)

You can grab the source code from:

source package : OpenSceneGraph-2.8.1-rc3.zip
svn tag: svn co
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.8.1-rc3
OpenSceneGraph

Please test with your apps and various build environments, and send in
feedback of success or failures to osg-users mailing lists/forum so we
can track convergence to the final 2.8.1 stable release.

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


[osg-users] setCursor problem

2009-04-27 Thread Romain Charbit
Hi,

I've seen some discussions about the mouse cursor, but it doesn't answer my 
question. 

How can I set a cursor with the function setCursor. When I make a setCursor :


Code:

osgViewer::GraphicsWindow::MouseCursor mouseCursor;
mouseCursor = osgViewer::GraphicsWindow::DestroyCursor;
gw->setCursor(mouseCursor);




 it does absolutely nothing. 

The only way I can have a cursor, is to do :


Code:

while(!viewer.done())
{
viewer.frame();
gw->setCursor(mouseCursor);
}




And it does not a proper set, it sets the new cursor only when the mouse is not 
moving.

I watched the source code, and I find it a bit confusing : 

osgViewer/GraphicsWindowWin32.cpp

GraphicsWindowWin32::setCursor( MouseCursor mouseCursor )


Code:

if (mouseCursor != LeftRightCursor && 
mouseCursor != UpDownCursor && 
mouseCursor != TopLeftCorner && 
mouseCursor != TopRightCorner && 
mouseCursor != BottomLeftCorner && 
mouseCursor != BottomRightCorner)
{
_appMouseCursor = mouseCursor;
}




then :

Code:

case WM_NCHITTEST :

...
...

default:
  if (_traits->useCursor && _appMouseCursor != InheritCursor)
   setCursor(LeftArrowCursor);
  break;






so if I set a cursor, _appMouseCursor will be equal to the new cursor, but will 
be erased by the case WM_NCHITTEST;

Is there something I'm missing?

Thank you.

Romain.


Romain Charbit

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10917#10917





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


Re: [osg-users] determine record type from OpenFlight files?

2009-04-27 Thread Paul Martz
Using a keyword in the description string would allow the exporter to filter
these strings out before writing Comment records. Great idea.

Back when I first started using OSG, I suggested replacing the current
UserData and DescriptionList mechanisms with some type of key-value std::map
based scheme. We had already been using such a scheme in our app at my
former employer. Robert didn't like the idea, but I don't remember the
details. Seems like such a scheme would allow multiple UserData per object,
which would be nice. On the other hand, it does require that operator<() be
declared for any object stored in the map, which can be a pain to have to
define.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859 9466

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Peter
Amstutz
Sent: Monday, April 27, 2009 8:41 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] determine record type from OpenFlight files?

I haven't looked at how DescriptionList is used in other parts of OSG, but
my thought was to use it with a key prefix, so the record type and other
metadata would be stored like "OpenFlight_Record=Geometry" or
"OpenFlight_Record=Road" or "OpenFlight_isTerrain=True".  To avoid the
problem you describe, the OpenFlight exporter will need to be aware of the
DescriptionList entries produced by the importer.

More generally, is there a particular reason for DescriptionList to be an
array of strings and not an associative array, like pair (or even a map, but that is a slightly heavier data structure)?  
As I mentioned I need to store custom attributes alongside scene graph nodes
and presently I am using UserData for this -- which is actually rather
problematic because UserData is not saved to the .ive file.  
Right now I merge the custom attributes from a separate XML file, but I
frequently have problems getting the external attributes file and scene
graph to line up (various things like to add container nodes at the top of
the scene graph, so the attributes file will be off by a node or two).

Thanks,
- Peter

Paul Martz wrote:
> I just realized... One issue with DescriptionList is that the 
> OpenFlight plugin uses it for Comment record data. This is really only 
> a problem if you load a FLT file, store the record type in the 
> DescriptionList, and then export it back out. Your record type data 
> would then be exported as comment records, which is probably not what you
want.
>
> I don't really see this as a showstopper issue though. Go for it.
>
> Paul Martz
> Skew Matrix Software LLC
> http://www.skew-matrix.com
> +1 303 859 9466
>
> -Original Message-
> From: osg-users-boun...@lists.openscenegraph.org
> [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Peter 
> Amstutz
> Sent: Friday, April 24, 2009 11:38 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] determine record type from OpenFlight files?
>
> Hmm, I never noticed the "DescriptionList" feature before -- I presume 
> DescriptionList gets saved to and loaded from .osg and .ive files?  
> That would simplify some other work I did to add custom attributes to 
> nodes (which I acomplished using UserData, but it is a bit more
complicated).
>
> I will take a look at the OpenFlight importer.
>
> Thanks,
> Peter
>   
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

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


Re: [osg-users] On demand and frame rate capping schemes from Viewer::run()

2009-04-27 Thread Robert Osfield
Hi Brett,

On Mon, Apr 27, 2009 at 3:35 PM, brettwiesner  wrote:
> Good stuff.Limit frame rate (ie, frame rate capping) is good. But how about
> Fixed frame rate though? Where the OSG renders at a specified frame rate no
> matter what.

It all depends on exactly you mean by "no matter what".

What are you thinking in terms of management of the scene to manage
this trick?   Magic?

One potentially could introduce a scheme of load balancing based on
LODScale that responds to frame rate load, but a scheme that works
well for all types of scenes will be next to impossible to come by.
We could potentially provide one that does good enough on a range of
models/application, but not perfectly for all application types.
There is also a real limit on how much LODScale can load balance, if
the scene graph itself isn't set up well with LOD then it won't make
any difference.

Personally I feel that most apps should manage the frame for their own
applications and data.  The OSG is a general purpose scene graph
rather than a domain specific IG.  It gives you the tools to do your
job, but it doesn't do it all for you.  The run() method stuff I've
introduced is really only for entry level app development.

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


Re: [osg-users] Use the mouse scroll button?

2009-04-27 Thread Robert Osfield
Hi Julio,

The TrackballManipulator now has support for mouse wheel, but as it
was added in March you'll need to grab one of the 2.9.x dev release
series or svn/trunk to get access to it.  Potentially you could
backport it to the version of the OSG you are using if it's not one of
the above.

Robert.

On Mon, Apr 27, 2009 at 3:14 PM, Julio Campos Alvarez
 wrote:
> Hello,
>
> I'm trying to use the mouse scroll button as if it was the right mouse
> button. All I want to do is move the camera closer and further with the
> mouse scroll button...
> The problem is that I don't receive the events by just moving the
>
> scroll. In order to get the event I need to press a button (either
> keyboard or mouse), once a button is pressed I will get all the events
> in the queue.
>
> Has anyone done something like this?
>
> Here is the code from my modified trackball manipulator:
>
>
> bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& us)
>   {
>   switch(ea.getEventType())
>   {
>   case(osgGA::GUIEventAdapter::FRAME):
>   if (_thrown)
>   {
>   if (calcMovement()) 
> us.requestRedraw();
>
>   }
>   return false;
>   default:
>   break;
>   }
>
>   if (ea.getHandled()) return false;
>
>   switch(ea.getEventType())
>   {
>   case(osgGA::GUIEventAdapter::PUSH):
>   {
>   flushMouseEventStack();
>
>   addMouseEvent(ea);
>   if (calcMovement()) us.requestRedraw();
>   us.requestContinuousUpdate(false);
>   _thrown = false;
>   return true;
>   }
>
>   case(osgGA::GUIEventAdapter::SCROLL):
>
>   {
>   int x = 0;
> //Here I have a brakpoint  :)
>   //_distance += 100.0f;
>   return true;
>   }
>   //
>
>   case(osgGA::GUIEventAdapter::KEYDOWN):
>   if (ea.getKey()== 
> osgGA::GUIEventAdapter::KEY_Space)
>   {
>   flushMouseEventStack();
>   _thrown = false;
>   home(ea,us);
>   return true;
>   }
>
>   return false;
>
>
> Thank you very much
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] determine record type from OpenFlight files?

2009-04-27 Thread Peter Amstutz
I haven't looked at how DescriptionList is used in other parts of OSG, 
but my thought was to use it with a key prefix, so the record type and 
other metadata would be stored like "OpenFlight_Record=Geometry" or 
"OpenFlight_Record=Road" or "OpenFlight_isTerrain=True".  To avoid the 
problem you describe, the OpenFlight exporter will need to be aware of 
the DescriptionList entries produced by the importer.


More generally, is there a particular reason for DescriptionList to be 
an array of strings and not an associative array, like pairstring> (or even a map, but that is a slightly heavier data structure)?  
As I mentioned I need to store custom attributes alongside scene graph 
nodes and presently I am using UserData for this -- which is actually 
rather problematic because UserData is not saved to the .ive file.  
Right now I merge the custom attributes from a separate XML file, but I 
frequently have problems getting the external attributes file and scene 
graph to line up (various things like to add container nodes at the top 
of the scene graph, so the attributes file will be off by a node or two).


Thanks,
- Peter

Paul Martz wrote:

I just realized... One issue with DescriptionList is that the OpenFlight
plugin uses it for Comment record data. This is really only a problem if you
load a FLT file, store the record type in the DescriptionList, and then
export it back out. Your record type data would then be exported as comment
records, which is probably not what you want.

I don't really see this as a showstopper issue though. Go for it.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859 9466

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Peter
Amstutz
Sent: Friday, April 24, 2009 11:38 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] determine record type from OpenFlight files?

Hmm, I never noticed the "DescriptionList" feature before -- I presume
DescriptionList gets saved to and loaded from .osg and .ive files?  That
would simplify some other work I did to add custom attributes to nodes
(which I acomplished using UserData, but it is a bit more complicated).

I will take a look at the OpenFlight importer.

Thanks,
Peter
  

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


Re: [osg-users] On demand and frame rate capping schemes from Viewer::run()

2009-04-27 Thread brettwiesner

Robert,

Good stuff.Limit frame rate (ie, frame rate capping) is good. But how 
about Fixed frame rate though? Where the OSG renders at a specified 
frame rate no matter what.


Thanks,
Brett

Robert Osfield wrote:

Hi All,

When following up on a bug report about the pager not handling on
demand/lazy frame rendering I resolved the the problems wasn't down to
the pager, just the way the end user viewer code was set up to the the
on demand frame rendering.  Rather than leave this type of viewer
usage open to end users come up with lots of different schemes to
attempt to the same thing, and with it the potential fall out in terms
of support of trying to help debug them I've coded up a solution for
osgViewer that can either be used directly or as a template for others
to learn from.

What I have done is to refactor osgViewer::ViewerBase::run() so that
it's frame loop now has two new capabilities:

   1) On demand (lazy) frame rendering  vs Continuous frame rendering
(the original functionality, and still the default.)
   2) Optional frame rate capping to a specified maximum frame rate
(defaults to off.)

Now item 2 isn't a required for on demand frame rendering, but it more
for coping with end user system not having vsync enabled by default.
Since I was working on this piece of code I thought I'd tackle this
item as well.  The actual ViewerBase::run() method (use by both Viewer
and CompositeViewer) now looks like:


int ViewerBase::run()
{
if (!isRealized())
{
realize();
}

const char* str = getenv("OSG_RUN_FRAME_COUNT");
int runTillFrameNumber = str==0 ? -1 : atoi(str);

while(!done() || (runTillFrameNumber>=0 &&
getViewerFrameStamp()->getFrameNumber()>runTillFrameNumber))
{
double minFrameTime = _runMaxFrameRate>0.0 ? 1.0/_runMaxFrameRate : 0.0;
osg::Timer_t startFrameTick = osg::Timer::instance()->tick();
if (_runFrameScheme==ON_DEMAND)
{
if (checkNeedToDoFrame()) frame();
}
else
{
frame();
}

// work out if we need to force a sleep to hold back the frame rate
osg::Timer_t endFrameTick = osg::Timer::instance()->tick();
double frameTime =
osg::Timer::instance()->delta_s(startFrameTick, endFrameTick);
if (frameTime < minFrameTime)
OpenThreads::Thread::microSleep(100.0*(minFrameTime-frameTime));
}

return 0;
}

The code isn't final yet, but is certainly good enough for us to start
testing.  You can test it by setting the env vars:

   OSG_RUN_FRAME_SCHEME=ON_DEMAND

or go back to default

   OSG_RUN_FRAME_SCHEME=CONTINUOUS

And

   OSG_RUN_MAX_FRAME_RATE=60.0

or switch off and the default

   OSG_RUN_MAX_FRAME_RATE=0.0


You can also use the following command line options:

  osgviewer cow.osg --run-on-demand

  osgviewer cow.osg --run-continuous

  osgviewer cow.osg --run-continuous  --run-max-frame-rate 30.0


The on demand frame rendering does already support paged databases,
and I've updated various event handles to manually do a
requestRedraw() which prompts the viewer::run() to rendering a new
frame.   What I have got working yet is handling of the update visitor
doing updates. so on demand rendering just freezes things like
particle systems and animations till you move the eye point, trigger
an event.  I'll have a look at support event callbacks next.

Please note this support only affect viewer::run() it doesn't effect
apps that roll their own frame loop.

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


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


[osg-users] Use the mouse scroll button?

2009-04-27 Thread Julio Campos Alvarez
Hello,

I'm trying to use the mouse scroll button as if it was the right mouse
button. All I want to do is move the camera closer and further with the
mouse scroll button...
The problem is that I don't receive the events by just moving the
scroll. In order to get the event I need to press a button (either
keyboard or mouse), once a button is pressed I will get all the events
in the queue.

Has anyone done something like this?

Here is the code from my modified trackball manipulator:

bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& us)
{
switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::FRAME):
if (_thrown)
{
if (calcMovement()) 
us.requestRedraw();
}
return false;
default:
break;
}

if (ea.getHandled()) return false;

switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::PUSH):
{
flushMouseEventStack();
addMouseEvent(ea);
if (calcMovement()) us.requestRedraw();
us.requestContinuousUpdate(false);
_thrown = false;
return true;
}

case(osgGA::GUIEventAdapter::SCROLL):
{
int x = 0;
//Here I have a brakpoint  :)
//_distance += 100.0f;
return true;
}
//
case(osgGA::GUIEventAdapter::KEYDOWN):
if (ea.getKey()== 
osgGA::GUIEventAdapter::KEY_Space)
{
flushMouseEventStack();
_thrown = false;
home(ea,us);
return true;
}
return false;


Thank you very much
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] The normal of my screen

2009-04-27 Thread Robert Osfield
HI Mangu? Liok?  Could you please sign your posts with your name so we
know how to address you.

On Mon, Apr 27, 2009 at 12:00 PM, Mangu Liok  wrote:
> Hi,
>
> If I want to know the normal of my screen (for lighting issues) does using 
> viewer.getCamera->getViewMatrixAsLookAt(eye,center,up) will give it to me as 
> 'eye'??

The *LookAt method gives the eye, center and up vector as per
gluLookAt.  The eye is obviously the up point, the center is the what
your are looking at, and the up is the up vector, all in world
coordinates.

The look vector is effectively (center-eye).   If you normalize this
you will effectively have the normal of the screen in world coords.

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


Re: [osg-users] The normal of my screen

2009-04-27 Thread Yurii Monakov
I am not sure about matrix layout convention used in OSG, but if it uses
OpenGL convention you can take third row of camera's view matrix (or third
column otherwise).

PS. Supposing that row (column) index starts with 1.

2009/4/27 Mangu Liok 

> Hi,
>
> If I want to know the normal of my screen (for lighting issues) does using
> viewer.getCamera->getViewMatrixAsLookAt(eye,center,up) will give it to me as
> 'eye'??
>
> Thank you.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=10906#10906
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG + Qt4.5 + Textures

2009-04-27 Thread Bence Frenyo
Hi all,
I hope this will help many in the future, I figured out the missing piece for 
this case.


Code:
void MyWidget::paintGL()
{
  glMatrixMode(GL_PROJECTION);
  glPushMatrix();
  glLoadIdentity();
  glMatrixMode(GL_MODELVIEW);
  glPushMatrix();
  glLoadIdentity();

  glPushAttrib(GL_ALL_ATTRIB_BITS);
  glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS);

  glShadeModel(GL_SMOOTH);

  osg::State *state = getCamera()->getGraphicsContext()->getState();
  state->reset();
  state->apply(_lastStateSet.get());

  frame();

  // this was the missing step:
  glViewport(0, 0, width(), height());
  glMatrixMode(GL_MODELVIEW);
  glLoadMatrixd(getCamera()->getViewMatrix().ptr());
  glMatrixMode(GL_PROJECTION);
  glLoadMatrixd(getCamera()->getProjectionMatrix().ptr());

  // here you can draw in OSG's 3D space

  
getCamera()->getGraphicsContext()->getState()->captureCurrentState(*_lastStateSet);

  glPopAttrib();
  glPopClientAttrib();

  glMatrixMode(GL_PROJECTION);
  glPopMatrix();
  glMatrixMode(GL_MODELVIEW);
  glPopMatrix();

  // here you can draw in Qt's 2D space
}




I'm actually not sure if everything here is needed, but this works.

Cheers
--
Bence

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10908#10908





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


Re: [osg-users] OpenSceneGraph-2.9.4 dev release tagged

2009-04-27 Thread John Ivar Haugland
I compiled OpenSceneGraph 2.9.4 on window XP and linux (RHEL4) with QT 4.5.1
. Tried out osgViewerQT.
I get a crash on both platform with the following command:

osgviewerQT --QOSGWidget cow.osg --MTCompositeViewer

(Segmentation fault)
(This command works fine with QT 4.5.1 in combination with OpenSceneGraph
2.8.0 on both windows and linux platform)
John Ivar Haugland
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] The normal of my screen

2009-04-27 Thread Mangu Liok
Hi,

If I want to know the normal of my screen (for lighting issues) does using 
viewer.getCamera->getViewMatrixAsLookAt(eye,center,up) will give it to me as 
'eye'??

Thank you.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10906#10906





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


Re: [osg-users] Is polygon on screen

2009-04-27 Thread Mangu Liok
drorlawa : OSG is very different from Vega Prime. frankly the only thing I miss 
in OSG is the LynX editor you have with Vega Prime. I believe someday such 
editor will be added to OSG.
To your question, afte you setup osgUtil::PolytopeIntersector to you r entire 
screen you will get all the polygon on screen it's up to you to search the one 
you need. using an iterator

osgUtil::PolytopeIntersector::Intersections::iterator it;
for (it = picker->getIntersections().begin() ; it != 
picker->getIntersections().end() ; ++it)
{
. do here what you nedd
}
that's it

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10905#10905





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


Re: [osg-users] Projective texture mapping with occluders/visibility computation

2009-04-27 Thread josselin . petit

Hi Max,

I'm not sure, but when you run your program, can't you see a line like :
"Scaling image '../Data_Calibrage/Image/IMG_5316_small.jpg' from  
<640,480> to <512,512>" ?


Otherwise, to do projective texture mapping, personaly I'm using  
shaders since I have back projection problems with OpenGl texture  
mapping.


For OpenGl texture mapping, you can look in the osgspotlight exemple.

Hope that helps,
Josselin.


This message was sent using IMP, the Internet Messaging Program.

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


[osg-users] Multiple screens

2009-04-27 Thread Guy
Hi all,

 I know this issue has been discussed a lot.

I just started to play with multiple screen (two screens)

 

I tried the examples (osgcompositeviewer, osgviewer, osgcamera) with the
different command arguments.

 

I use osg2.8 have NVIDIA 8800, windows XP and just installed the latest
drivers

 

Anyway, the examples worked only after I set in the NVIDIA control panel
that I want to use the second display as the primary display.

 

If I tried the first display to be the primary, the second display did
not render at all. The windows were created but did not render.

 

Any ideas?

 

Thanks,

 Guy.

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


Re: [osg-users] OpenSceneGraph always opening in fullscreen on Intel integrated graphics.

2009-04-27 Thread Jesper D. Thomsen
Hi, I'm not currently using multisampling in the window, as we have an option 
in the application where we can switch to an older OpenGL renderer for the 
viewport, and this older implementation doesn't like multisampling. I'm however 
not having any problems with OpenGL state, as I don't use any direct OpenGL in 
the cases where I'm having the fullscreen problem.
I just dug up an old computer with integrated Intel 82865G graphics (which 
supports OpenGL 1.3), and that computer works fine with windowed OpenSceneGraph 
use (even with standard Windows XP graphics drivers).

regards,

Jesper D. Thomsen

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ümit Uzun 
[umituzu...@gmail.com]
Sent: Monday, April 27, 2009 11:14 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] OpenSceneGraph always opening in fullscreen on Intel 
integrated graphics.


Hi Jesper;

As I can see from attached codes you didn't used traits->samples = (any int 
value); but you may be set multisampling in your code from using

osg::DisplaySettings* ds = new osg::DisplaySettings();
ds->setNumMultiSamples( 4 );

or osgUtil namespaces function(I have forgotten the name of this function.).

If you try to anti aliasing operation by using MultiSampling, this could be 
cause full screen problem which I had had kind of that before and solved by 
removing multisampling operation.

HTH.Regards.

2009/4/27 Jesper D. Thomsen mailto:j...@anybodytech.com>>
Hi all (again), and thanks for your help in the past.

We have now shipped an application using OpenSceneGraph for the 3D viewports of 
a model. We are now receiving a couple of bug-reports (2 so far) from users 
running the application on laptops with Intel integrated graphics (GMA 950 and 
3100). We are using OpenSceneGraph in an MFC window in the application, but 
whenever these two users open the viewport window (and thus starting the 
OpenSceneGraph part of the application), the OpenSceneGraph viewer starts in 
fullscreen (no menus or windows bar visible), which of course means that they 
have to use the task manager to quit the application.

Both users are using Windows XP pro. The OSG version used is 2.6.1, compiled 
with Visual Studio 2005 SP1 under Vista. The application is using MFC, and the 
OpenSceneGraph viewport is based on the MFCViewer example. The code for 
creating the viewer can be found below. Does anybody know why OSG suddenly will 
be forced to work in fullscreen, and is it generally because of some specific 
lack of OpenGL support?

Any help will be much appreciated.

--- Code: --

void

cOSG::InitCameraConfig(void)

{

// Local Variable to hold window size data

RECT rect;

// Create the viewer for this window

mViewer =

new osgViewer::Viewer();

mViewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);

// Get the current window size

::GetWindowRect(m_hWnd, &rect);

// Init the GraphicsContext Traits

osg::ref_ptr traits =

new osg::GraphicsContext::Traits;

// Init the Windata Variable that holds the handle for the Window to display 
OSG in.

osg::ref_ptr windata =

new osgViewer::GraphicsWindowWin32::WindowData(m_hWnd);

// Setup the traits parameters

traits->x = 0;

traits->y = 0;

traits->width = rect.right - rect.left;

traits->height = rect.bottom - rect.top;

traits->windowDecoration =

false;

traits->doubleBuffer =

true;

traits->sharedContext = 0;

traits->setInheritedWindowPixelFormat =

true;

traits->inheritedWindowData = windata;

// Create the Graphics Context

osg::GraphicsContext* gc = 
osg::GraphicsContext::createGraphicsContext(traits.get());

// Init a new Camera (Master for this View)

camera = mViewer->getCamera();

// Assign Graphics Context to the Camera

camera->setGraphicsContext(gc);

// Set the viewport for the Camera

camera->setViewport(

new osg::Viewport(traits->x, traits->y, traits->width, traits->height));

// Add the Camera to the Viewer

mViewer->setCamera(camera.get());

// Add the Camera Manipulator to the Viewer

//-Picking Test--

mViewer->addEventHandler(m_PickHandler.get());

//---

// Set the Scene Data

mViewer->setSceneData(mRoot.get());

mViewer->getCamera()->setProjectionResizePolicy(osg::Camera::FIXED);

}

--- end code --

Regards,


Jesper D. Thomsen



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




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


Re: [osg-users] OpenSceneGraph always opening in fullscreen on Intel integrated graphics.

2009-04-27 Thread Ümit Uzun
Hi Jesper;

As I can see from attached codes you didn't used traits->samples = (any int
value); but you may be set multisampling in your code from using

osg::DisplaySettings* ds = new osg::DisplaySettings();
ds->setNumMultiSamples( 4 );

or osgUtil namespaces function(I have forgotten the name of this function.).


If you try to anti aliasing operation by using MultiSampling, this could be
cause full screen problem which I had had kind of that before and solved by
removing multisampling operation.

HTH.Regards.

2009/4/27 Jesper D. Thomsen 

>  Hi all (again), and thanks for your help in the past.
>
> We have now shipped an application using OpenSceneGraph for the 3D
> viewports of a model. We are now receiving a couple of bug-reports (2 so
> far) from users running the application on laptops with Intel integrated
> graphics (GMA 950 and 3100). We are using OpenSceneGraph in an MFC window in
> the application, but whenever these two users open the viewport window (and
> thus starting the OpenSceneGraph part of the application), the
> OpenSceneGraph viewer starts in fullscreen (no menus or windows bar
> visible), which of course means that they have to use the task manager to
> quit the application.
>
> Both users are using Windows XP pro. The OSG version used is 2.6.1,
> compiled with Visual Studio 2005 SP1 under Vista. The application is using
> MFC, and the OpenSceneGraph viewport is based on the MFCViewer example. The
> code for creating the viewer can be found below. Does anybody know why OSG
> suddenly will be forced to work in fullscreen, and is it generally because
> of some specific lack of OpenGL support?
>
> Any help will be much appreciated.
>
> --- Code: --
>
> void
> cOSG::InitCameraConfig(void)
>
> {
>
> // Local Variable to hold window size data
>
> RECT rect;
>
> // Create the viewer for this window
>
> mViewer =
> new osgViewer::Viewer();
>
> mViewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
>
> // Get the current window size
>
> ::GetWindowRect(m_hWnd, &rect);
>
> // Init the GraphicsContext Traits
>
> osg::ref_ptr traits =
> new osg::GraphicsContext::Traits;
>
> // Init the Windata Variable that holds the handle for the Window to
> display OSG in.
>
> osg::ref_ptr windata =
> new osgViewer::GraphicsWindowWin32::WindowData(m_hWnd);
>
> // Setup the traits parameters
>
> traits->x = 0;
>
> traits->y = 0;
>
> traits->width = rect.right - rect.left;
>
> traits->height = rect.bottom - rect.top;
>
> traits->windowDecoration =
> false;
>
> traits->doubleBuffer =
> true;
>
> traits->sharedContext = 0;
>
> traits->setInheritedWindowPixelFormat =
> true;
>
> traits->inheritedWindowData = windata;
>
> // Create the Graphics Context
>
> osg::GraphicsContext* gc =
> osg::GraphicsContext::createGraphicsContext(traits.get());
>
> // Init a new Camera (Master for this View)
>
> camera = mViewer->getCamera();
>
> // Assign Graphics Context to the Camera
>
> camera->setGraphicsContext(gc);
>
> // Set the viewport for the Camera
>
> camera->setViewport(
> new osg::Viewport(traits->x, traits->y, traits->width, traits->height));
>
> // Add the Camera to the Viewer
>
> mViewer->setCamera(camera.get());
>
> // Add the Camera Manipulator to the Viewer
>
> //-Picking Test--
>
> mViewer->addEventHandler(m_PickHandler.get());
>
> //---
>
> // Set the Scene Data
>
> mViewer->setSceneData(mRoot.get());
>
> mViewer->getCamera()->setProjectionResizePolicy(osg::Camera::FIXED);
>
> }
>  --- end code --
>
> Regards,
>
>
> Jesper D. Thomsen
>
> * *
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


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


Re: [osg-users] Rendering transparent/opaque objects separately in deferred renderer using osg::RenderBin - how?

2009-04-27 Thread Jirka
Thank you, Robert, for your advice, I appreciate it.

I'll probably take the cull traversal mask approach, since I don't have much 
spare time and it seems easier to implement. I'll post my results as soon as I 
have them if someone else deals with the same problem.

Regards, Jirka.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10899#10899





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


[osg-users] OpenSceneGraph always opening in fullscreen on Intel integrated graphics.

2009-04-27 Thread Jesper D. Thomsen
Hi all (again), and thanks for your help in the past.

We have now shipped an application using OpenSceneGraph for the 3D viewports of 
a model. We are now receiving a couple of bug-reports (2 so far) from users 
running the application on laptops with Intel integrated graphics (GMA 950 and 
3100). We are using OpenSceneGraph in an MFC window in the application, but 
whenever these two users open the viewport window (and thus starting the 
OpenSceneGraph part of the application), the OpenSceneGraph viewer starts in 
fullscreen (no menus or windows bar visible), which of course means that they 
have to use the task manager to quit the application.

Both users are using Windows XP pro. The OSG version used is 2.6.1, compiled 
with Visual Studio 2005 SP1 under Vista. The application is using MFC, and the 
OpenSceneGraph viewport is based on the MFCViewer example. The code for 
creating the viewer can be found below. Does anybody know why OSG suddenly will 
be forced to work in fullscreen, and is it generally because of some specific 
lack of OpenGL support?

Any help will be much appreciated.

--- Code: --

void cOSG::InitCameraConfig(void)

{

// Local Variable to hold window size data

RECT rect;

// Create the viewer for this window

mViewer = new osgViewer::Viewer();

mViewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);

// Get the current window size

::GetWindowRect(m_hWnd, &rect);

// Init the GraphicsContext Traits

osg::ref_ptr traits = new 
osg::GraphicsContext::Traits;

// Init the Windata Variable that holds the handle for the Window to display 
OSG in.

osg::ref_ptr windata = new 
osgViewer::GraphicsWindowWin32::WindowData(m_hWnd);

// Setup the traits parameters

traits->x = 0;

traits->y = 0;

traits->width = rect.right - rect.left;

traits->height = rect.bottom - rect.top;

traits->windowDecoration = false;

traits->doubleBuffer = true;

traits->sharedContext = 0;

traits->setInheritedWindowPixelFormat = true;

traits->inheritedWindowData = windata;

// Create the Graphics Context

osg::GraphicsContext* gc = 
osg::GraphicsContext::createGraphicsContext(traits.get());

// Init a new Camera (Master for this View)

camera = mViewer->getCamera();

// Assign Graphics Context to the Camera

camera->setGraphicsContext(gc);

// Set the viewport for the Camera

camera->setViewport(new osg::Viewport(traits->x, traits->y, traits->width, 
traits->height));

// Add the Camera to the Viewer

mViewer->setCamera(camera.get());

// Add the Camera Manipulator to the Viewer

//-Picking Test--

mViewer->addEventHandler(m_PickHandler.get());

//---

// Set the Scene Data

mViewer->setSceneData(mRoot.get());

mViewer->getCamera()->setProjectionResizePolicy(osg::Camera::FIXED);

}

--- end code --

Regards,

Jesper D. Thomsen

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


Re: [osg-users] Picking, how to identify object?

2009-04-27 Thread David Callu
hi Paul

You have an UserData property in osg::Object and so in osg::Node by
inheritance.
You can assign any osg::Referenced based class to it.

Another solution could be to use std::map >
or boost::bimap >

HTH
David

2009/4/27 Paul 

> Hi,
>
> Im using the code from osgpick example. How do I identify the object being
> picked as refering to it by name has little use.
>
> Can I assign some user data to the objects such as an id? or extra
> information
>
> Thank you.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=10892#10892
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Projective texture mapping with occluders/ visibility computation

2009-04-27 Thread Max
Hi all,

I beg your pardon for being that boring, but no one's got a solution for this?


Max wrote:
> 
> 3)It seems I can't do the PTM using osg::TextureRectangle but osg::Texture2D 
> works.
> I'm running OpenSceneGraph 2.6 maybe this have been fixed since that version.
> Thus I need to know the new width and height of my resized image (which is 
> done in order to match to Texture2D).
> But when I execute:
> 
> 
> Code:
> 
> ref_ptr img = 
> osgDB::readImageFile("../Data_Calibrage/Image/IMG_5316_small.jpg");
>   
>   //TextureRectangle doesn't seem to be supported for projective texture 
> mapping
>   ref_ptr tex = new Texture2D(img.get());
>   std::cout<<"Width of the texture: " " "s()<   std::cout<<"Height of the image of the texture: 
> "t()< 
> 
> 
> I've got:
> 
> Code:
> 
> 0
> 0
> 640
> 480
> 
> 
> 
> 
> How can I know these new width and height ?


Thanks (at least for reading ;) )

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10897#10897





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


Re: [osg-users] [osgPlugins] Failed to read unsigned int value??

2009-04-27 Thread Robert Osfield
Hi Akilan,

It might be that your .ive database was built from a different version
of the OSG than your OSG version.

The OSG is now at 2.8, is there a reason why you are using 2.2 over
2.8, the later has many bug fixes applied to it over 2.2 as well as
more refined API and functionality.

Robert.

On Mon, Apr 27, 2009 at 6:03 AM, Akilan  wrote:
> Hi,
>
> While adding blumarble's .ive file as a child to a group in my application, I 
> m getting the following warning and error,
>
> Warning: Could not find plug-in to read objects from file 
> "C:\BlueMarble\output_L0_X0_Y0_Subtile.ive"
>
> Error reading file: DataInputStream::readUInt():Failed to read unsigned int 
> value
>
> I have installed OSG2.2(on Windows XP)  in my system and all my dlls are in 
> OSG_FILE_PATH and PATH too.
>
> What could be the problem
>
>
> Thank you.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=10889#10889
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Fwd: shader implementation - newbie

2009-04-27 Thread Robert Osfield
Hi Sajjad,

A lot has been written about shaders and OSG over the years, so rather
than me waste time going over old ground please could you search the
archives.

Robert.

On Mon, Apr 27, 2009 at 2:47 AM, ami guru  wrote:
> Hello Robert,
>
> After going through several source code regarding shaders, i think  that
> using seperate program for different type of shader is a better
> choice.
>
> In that case i am creating a vector<> of osg::Program initially, and
> attaching the shaders corresponding to the programs.
>
> Now with user input i am trying to enable a particular program . In OpenGL
> there is a command named
>
> glUseProgram(id);
>
> To enable the program which we can link and validate later. It is like
> toggling between different program object.
>
>
> In OSG i think we have to toggle between StateSet.
>
>
> Can you suggest any example with in OSG that does that state changes in an
> interactive way?
>
>
>
> Regards
> Sajjad
>
> -- Forwarded message --
> From: ami guru 
> Date: Sun, Apr 26, 2009 at 7:30 AM
> Subject: Fwd: [osg-users] shader implementation - newbie
> To: OpenSceneGraph Users 
>
>
> Hello Robert,
>
> Thanks for the feedback.
>
> I am trying to design the interface as follows:
>
> if(userEvent == "Toon Shader")
> {
>    //adding the corresponding shader to  the program for the StateSet of the
> model
> }
> else if(userEvent == "Gooch Shader")
> {
>    //adding the corresponding shader to  the program for the StateSet of the
> model
> }
>
>
> Now If the user select the Toon Shader several times at several instances
> the very same shader will be added several times.
>
> I was thinking about loading all the shaders that i want to incorporate
> within in my application during the class's constructor and make the
> particular shader active during user selection .
>
> Is there any way within OSG to activate a particular shader while
> deactivating the rest of them?
>
>
> I have one model in my scene that i want to apply different shader on it.
>
>
>
> Regards
> Sajjad
>
>
>
>
>
>
> -- Forwarded message --
> From: Robert Osfield 
> Date: Sat, Apr 25, 2009 at 10:43 AM
> Subject: Re: [osg-users] shader implementation - newbie
> To: OpenSceneGraph Users 
>
>
> HI Sajjad,
>
> osg::Program has have a list of shaders, think of shaders like .cpp's
> that go together to make a C++ program.  You can have just the main or
> a whole series of separate files.  The osg::Program is what tells the
> OSG/OpenGL what shaders should linked together to make the final
> program downloaded to the GPU.
>
> Now if you want different compositions of shaders at different points
> in your scene graphs then you'll need to link them together with
> separate osg::Program, or use a single osg::Program and uniforms to
> option select different paths in the shaders.
>
> Robert.
>
> On Sat, Apr 25, 2009 at 7:54 AM, ami guru  wrote:
>> Hello forum,
>>
>> I am trying to implement some of  the shaders in a single OSG application.
>> At  the same time i was going through the osgshaders example and if i have
>> understood that correctly,
>> i saw that the example has separate osg::program for different shaders
>>
>> I was wondering if it is possible to have one single program to manage all
>> the shaders. I think osg::Program
>> contains a vector of shaders.
>>
>> Is that possible to store different shaders by different name and load
>> that
>> according to  the user selection;
>> delete previous shader and load the currently selected one.
>>
>>
>> Or separate osg::program for different shader example is best approach.
>>
>> I am considering different design issue here.
>>
>> Any opinion regarding that will be helpful.
>>
>>
>> Thanks
>> Sajjad
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Rendering transparent/opaque objects separately in deferred renderer using osg::RenderBin - how?

2009-04-27 Thread Robert Osfield
HI Jirka,

Post processing generated the RenderStage/RenderBin's after the cull
traversals has complete on a subgraph can be a useful way to manage
techniques like your are suggesting, it does require you to understand
the details of the rendering backend though so it's not something I
would recommend for most users - it's very much an advanced topic.  If
it's appropriate in your case it may well make life much easier once
you've over come the initial learning curve on it, I'm afraid there is
no shot cut - learning from the source code in this instance will be
your best bet.

One thing you can do with the rendering back end is to create new
bins/stages and also move bins around.  In your case if you want to
handle the whole transparent bin separately then creating a separate
RenderStage for it, then moving the bin from it's original RenderStage
to it's new one could be done with a couple of lines of code.   This
would be better than trying to play games of switch on/off rendering
via state.

The other appropriate you could take is to use traversal masks for
opaque and transparent objects and use two camera that do rendering to
texture, and use different cull traversal masks for each camera to
pick out the different parts of the scene graph.  You'd need to apply
the different masks to the geodes that contains opaque and transparent
geometry.  This approach won't be quite as fast as the RenderBin
management done via a cull callback due to the extra traversals
required, but it would probably be easier in terms of using the OSG
front end, rather than the back end as the front end of the OSG is
better documented and cleaner (it's the public API that is meant to be
used, the back end is just the implementation so this is a natural
balance.)


Robert.

On Sun, Apr 26, 2009 at 10:39 AM, Jirka  wrote:
> Hi,
>
> I work on a deferred renderer for my master thesis. Everything is fine and 
> now I want to correctly render transparent objects. I want to use forward 
> rendering for that taks - just render the transparent objects in one pass, 
> blend them together and add it to buffer of rendered opaque objects (by 
> deferred rendering).
>
> The problem is that I don't now how to correctly access opaque/transparent 
> objects in my scene graph to render them separately and combine them in the 
> final stage of deferred renderer. I have found a disscussion 
> http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2008-July/014769.html
>  where access to render bin #10 (which should always contain transparent 
> geometry ?) is described. So I got and idea that I could create my custom 
> scene graph node (derived from osg::Geode) and redefine its traversal method, 
> where I would "discard" the render bin for transparent/opaque objects after 
> the cull traversal.
> I modified the code from the discussion a little bit and I mask depth and 
> color buffer for writing when rendering transparent objects (don't know how 
> to acctually remove transparent drawables from particular render bin):
>
>
> Code:
>
> void RenderBinMaskNode::traverse(osg::NodeVisitor& nv) {
>
>    this->osg::Group::traverse( nv );
>
>    // Clone render-bin 10 if this is a cull visitor
>    if ( nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR ) {
>
>        osgUtil::CullVisitor* cv = dynamic_cast( &nv );
>
>        if ( cv ) {
>            // Act if we have a RenderStage pointer
>            if ( osgUtil::RenderStage* renderStage = cv->getRenderStage() ) {
>                // Get the render-bin list
>                osgUtil::RenderBin::RenderBinList& binList = 
> renderStage->getRenderBinList();
>
>                                    osg::notify(osg::ALWAYS) << "RENDER BIN 
> LIST SIZE: " << binList.size() << std::endl;
>
>                                    // go to renderbin which stores 
> transparent drawables (always number 10 ?)
>                                    if( binList.find(10) != binList.end() ) {
>                                            // for this render bin, do not 
> render its content
>                                            osg::StateSet* binStateSet = 
> binList[10]->getStateSet();
>
>                                            // mask depth buffer
>                                            binStateSet->setAttributeAndModes( 
> new osg::Depth(osg::Depth::LESS, 0.0, 1.0, false), osg::StateAttribute::ON | 
> osg::StateAttribute::OVERRIDE );
>
>                                            // mask color buffer
>                                            binStateSet->setAttributeAndModes( 
> new osg::ColorMask(false, false, false, false), osg::StateAttribute::ON | 
> osg::StateAttribute::OVERRIDE );
>
>                                            // TO DO: stencil and accum mask
>                                    }
>                      }
>        }
>    }
> }
>
>
>
>
>
> If I add this custom node as a child of my camera node and the scene itself 
> as a child of my custom node, then no transparent ob

Re: [osg-users] [build] osgdb_freetype build problem on Mac OS/X 10.5.6

2009-04-27 Thread Robert Osfield
Hi Jaeyong,

Sounds like you have Inventor installed on your system so the OSG's
Cmake build system is picking up on this and enabling the build of the
Inventor plugin (to be able to read .iv and .wrl files.)  Alas once
the build start going on this plugin it compiles by fails on link due
to the Inventor library itself not being built with the same processor
architectures supported by the OSG build.  This can happen if the 3rd
party library is built for just ppc or just 386, while the OSG by
default is building as a unified build with ppc and 386 paths.

To get things building you could either disable the building of the
Inventor plugin by running ccmake make and the scrolling down to the
inventor related env vars and resetting them, then pressing 'c' to
configure, and 'g' to generate the final build system, or disable the
build of both ppc and 386 architectures, again via cmake.

Robert.

On Sun, Apr 26, 2009 at 8:54 AM, Jaeyoung Haan  wrote:
> I'm trying to install OSG on my Mac OSX 10.5.6 in order to develop 3D 
> simulation.
> I'm not going to use Xcode.
>
> I downloaded osg source codes thru svn 2.8.1 rc, installed Cmake,
> and did ./configure and make.
>
> But the following error occurred, and I could not figure it out.
> Plz help me.
>
>
> Code:
>
> Scanning dependencies of target osgdb_iv
> [ 80%] Building CXX object 
> src/osgPlugins/Inventor/CMakeFiles/osgdb_iv.dir/ConvertToInventor.cpp.o
> [ 80%] Building CXX object 
> src/osgPlugins/Inventor/CMakeFiles/osgdb_iv.dir/ConvertFromInventor.cpp.o
> [ 80%] Building CXX object 
> src/osgPlugins/Inventor/CMakeFiles/osgdb_iv.dir/GroupSoLOD.cpp.o
> [ 80%] Building CXX object 
> src/osgPlugins/Inventor/CMakeFiles/osgdb_iv.dir/PendulumCallback.cpp.o
> [ 80%] Building CXX object 
> src/osgPlugins/Inventor/CMakeFiles/osgdb_iv.dir/ReaderWriterIV.cpp.o
> [ 80%] Building CXX object 
> src/osgPlugins/Inventor/CMakeFiles/osgdb_iv.dir/ShuttleCallback.cpp.o
> Linking CXX shared module ../../../lib/osgPlugins-2.8.1/osgdb_iv.so
> ld warning: in 
> /Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks//Inventor.framework/Inventor,
>  file is not of required architecture
> Undefined symbols for architecture ppc:
>  "SoNode::writeInstance(SoOutput*)", referenced from:
>      vtable for GroupSoLODin GroupSoLOD.cpp.o
>  "SoVRMLTexture::getClassTypeId()", referenced from:
>      ConvertFromInventor::preVRMLAppearance(void*, SoCallbackAction*, SoNode 
> const*)in ConvertFromInventor.cpp.o
>  "SoFieldData::~SoFieldData()", referenced from:
>      GroupSoLOD::atexit_cleanup()       in GroupSoLOD.cpp.o
>
>
>
> ... hundreds lines of similar messages ...
>
>
>
>
> "SoGroup::replaceChild(int, SoNode*)", referenced from:
>      vtable for GroupSoLODin GroupSoLOD.cpp.o
>  "SoLOD::getClassTypeId()", referenced from:
>      ConvertFromInventor::preGroup(void*, SoCallbackAction*, SoNode const*)in 
> ConvertFromInventor.cpp.o
>      ConvertFromInventor::postGroup(void*, SoCallbackAction*, SoNode 
> const*)in ConvertFromInventor.cpp.o
>      GroupSoLOD::initClass()      in GroupSoLOD.cpp.o
>  "SoMFUInt32::getClassTypeId()", referenced from:
>      bool ivApplicateIntType(osg::Array const*, 
> SoMFUInt32&, int, int, int)in ConvertToInventor.cpp.o
>  "SoSphere::SoSphere()", referenced from:
>      ConvertToInventor::processShapeDrawable(osg::ShapeDrawable const*, 
> ConvertToInventor::InventorState*)::MyShapeVisitor::apply(osg::Sphere 
> const&)in ConvertToInventor.cpp.o
> ld: symbol(s) not found for architecture ppc
> collect2: ld returned 1 exit status
> lipo: can't open input file: 
> /var/folders/bf/bf+HkrbPFfGBxK0g6Fm5vE+++TI/-Tmp-//cc9Swfmi.out (No such file 
> or directory)
> make[2]: *** [lib/osgPlugins-2.8.1/osgdb_iv.so] Error 1
> make[1]: *** [src/osgPlugins/Inventor/CMakeFiles/osgdb_iv.dir/all] Error 2
> make: *** [all] Error 2
>
>
> [/code]
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=10871#10871
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Picking, how to identify object?

2009-04-27 Thread Paul
Hi,

Im using the code from osgpick example. How do I identify the object being 
picked as refering to it by name has little use.

Can I assign some user data to the objects such as an id? or extra information

Thank you.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10892#10892





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