[osg-users] Rotation animation

2012-10-25 Thread Héctor Martínez
Hi,

 

I am trying to make an animation to one model. What I want is to rotate the
model around its own axis and also to translate (rotation again) around
another pivot point, like Earth movements. I can achieve both movements
separately, but I don’t know how to make both animations work at the same
time. I have tried nesting animations and similar ideas, but without luck.

 

Could somebody give me some clues to get the solution to my problem?

 

Thank you in advance,

 

Best regards

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


[osg-users] HELP~OSG forAndroid crashed~~~

2012-10-25 Thread houhouh
hi,everyone here
i have built OSG for Android and complie the example osgAndroidExampleGLES1.I 
load a earth model it runs sucessfully.But it crashed unexpected.Log as showed 
follow:
10-25 15:57:03.710: INFO/DEBUG(1732): *** *** *** *** *** *** *** *** *** *** 
*** *** *** *** *** ***
10-25 15:57:03.710: INFO/DEBUG(1732): Build fingerprint: 
'samsung/GT-P7510/GT-P7510:3.1/HMJ37/ZCKH1:user/release-keys'
10-25 15:57:03.710: INFO/DEBUG(1732): pid: 2227, tid: 2235   
osg.AndroidExample 
10-25 15:57:03.710: INFO/DEBUG(1732): signal 11 (SIGSEGV), code 1 
(SEGV_MAPERR), fault addr 
10-25 15:57:03.710: INFO/DEBUG(1732):  r0 0032a2a0  r1 002f9300  r2   
r3 0032a2a0
10-25 15:57:03.710: INFO/DEBUG(1732):  r4 00329cc0  r5 839e4f7d  r6 83e47168  
r7 40183f58
10-25 15:57:03.710: INFO/DEBUG(1732):  r8 5ec4ab70  r9 40183f50  10 40183f3c  
fp fe90
10-25 15:57:03.710: INFO/DEBUG(1732):  ip 83677215  sp 5ec4aa58  lr 83b7c8c3  
pc   cpsr 0010
10-25 15:57:03.710: INFO/DEBUG(1732):  d0  3de5d93a5acfd57c  d1  

10-25 15:57:03.710: INFO/DEBUG(1732):  d2  be5ae56481ee2cda  d3  
bfc55228f9fedc91
10-25 15:57:03.710: INFO/DEBUG(1732):  d4  3f548882600be91f  d5  
3f810fdb8fcd2457
10-25 15:57:03.710: INFO/DEBUG(1732):  d6  3fbb8c153257d559  d7  
3fbb8c153257d559
10-25 15:57:03.710: INFO/DEBUG(1732):  d8    d9  

10-25 15:57:03.710: INFO/DEBUG(1732):  d10   d11 

10-25 15:57:03.710: INFO/DEBUG(1732):  d12   d13 

10-25 15:57:03.710: INFO/DEBUG(1732):  d14   d15 

10-25 15:57:03.710: INFO/DEBUG(1732):  scr 2012
10-25 15:57:03.980: INFO/DEBUG(1732):  #00  pc   
10-25 15:57:03.980: INFO/DEBUG(1732):  #01  pc 00b7c8c0  
/data/data/osg.AndroidExample/lib/libosgNativeLib.so 
(_ZN3osg5Group8traverseERNS_11NodeVisitorE)
10-25 15:57:03.980: INFO/DEBUG(1732):  #02  pc 00689590  
/data/data/osg.AndroidExample/lib/libosgNativeLib.so 
(_ZN3osg11NodeVisitor8traverseERNS_4NodeE)
10-25 15:57:03.980: INFO/DEBUG(1732):  #03  pc 00ae9ce8  
/data/data/osg.AndroidExample/lib/libosgNativeLib.so 
(_ZN7osgUtil13UpdateVisitor29handle_callbacks_and_traverseERN3osg4NodeE)
10-25 15:57:03.980: INFO/DEBUG(1732):  #04  pc 00ae9bd0  
/data/data/osg.AndroidExample/lib/libosgNativeLib.so 
(_ZN7osgUtil13UpdateVisitor5applyERN3osg5GroupE)
10-25 15:57:03.980: INFO/DEBUG(1732):  #05  pc 009aa686  
/data/data/osg.AndroidExample/lib/libosgNativeLib.so 
(_ZN3osg5Group6acceptERNS_11NodeVisitorE)
10-25 15:57:03.980: INFO/DEBUG(1732):  #06  pc 0088f4b6  
/data/data/osg.AndroidExample/lib/libosgNativeLib.so 
(_ZN9osgViewer5Scene16updateSceneGraphERN3osg11NodeVisitorE)
10-25 15:57:03.980: INFO/DEBUG(1732): libc base address: aff0
10-25 15:57:03.980: INFO/DEBUG(1732): code around pc:
10-25 15:57:03.980: INFO/DEBUG(1732):     
 
10-25 15:57:03.980: INFO/DEBUG(1732): 0010    
 
10-25 15:57:03.980: INFO/DEBUG(1732): 0020    
 
10-25 15:57:03.980: INFO/DEBUG(1732): 0030    
 
10-25 15:57:03.980: INFO/DEBUG(1732): 0040    
 
10-25 15:57:03.980: INFO/DEBUG(1732): code around lr:
10-25 15:57:03.980: INFO/DEBUG(1732): 83b7c8a0 e0129303 1c18ab03 f904f673 
1c181c03 
10-25 15:57:03.980: INFO/DEBUG(1732): 83b7c8b0 ebf0f6b7 681a1c03 6812326c 
1c189900 
10-25 15:57:03.980: INFO/DEBUG(1732): 83b7c8c0 ab034790 f6551c18 9b01fa75 
1c183374 
10-25 15:57:03.980: INFO/DEBUG(1732): 83b7c8d0 f9f2f655 93021c03 ab02aa03 
1c191c10 
10-25 15:57:03.980: INFO/DEBUG(1732): 83b7c8e0 fa50f655 2b001c03 b005d1dc 
46c0bd00 
10-25 15:57:03.980: INFO/DEBUG(1732): stack:
10-25 15:57:03.980: INFO/DEBUG(1732): 5ec4aa18  839d06a5  
/data/data/osg.AndroidExample/lib/libosgNativeLib.so
10-25 15:57:03.980: INFO/DEBUG(1732): 5ec4aa1c  5ec4aa48  
10-25 15:57:03.980: INFO/DEBUG(1732): 5ec4aa20  83e321a8  
10-25 15:57:03.980: INFO/DEBUG(1732): 5ec4aa24  839d0bad  
/data/data/osg.AndroidExample/lib/libosgNativeLib.so
10-25 15:57:03.980: INFO/DEBUG(1732): 5ec4aa28  8c7bf078  
10-25 15:57:03.980: INFO/DEBUG(1732): 5ec4aa2c  0004ccdd  
10-25 15:57:03.980: INFO/DEBUG(1732): 5ec4aa30    
10-25 15:57:03.980: INFO/DEBUG(1732): 5ec4aa34    
10-25 15:57:03.980: INFO/DEBUG(1732): 5ec4aa38  002fa570  
10-25 15:57:03.980: INFO/DEBUG(1732): 5ec4aa3c  5ec4aa4c  
10-25 15:57:03.980: INFO/DEBUG(1732): 5ec4aa40  83e321a8  
10-25 15:57:03.980: INFO/DEBUG(1732): 5ec4aa44  5ec4aa60  
10-25 15:57:03.980: INFO/DEBUG(1732): 5ec4aa48  5ec4aa60  
10-25 15:57:03.980: INFO/DEBUG(1732): 5ec4aa4c  5ec4aa64  
10-25 15:57:03.980: INFO/DEBUG(1732): 5ec4aa50  df002777  
10-25 15:57:03.980: INFO/DEBUG(1732): 5ec4aa54  e3a070ad  
10-25 15:57:03.980: 

[osg-users] Forum not working

2012-10-25 Thread michael kapelko
Hi.
I get the following error when try to access the forum:

phpBB : Critical Error

Could not connect to the database
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] about the cull mechanism in osg

2012-10-25 Thread Robert Osfield
Hi Shawl,

On 19 October 2012 06:52, wh_xiexing wh_xiex...@sina.com wrote:
  i am newbie . my question is , i have a group which contains a lot
 a gode.  in order to speed the rendering .  i don't know whether i need to
 write a  cull callback .  or do nothing and let the osg system do the
 culling work instead .  does osg automatically traverse the group and  cull
 the node which lay out the frustum ???

The OSG provide a full range of culling mechanism, the key one is view
frustum culling.  All you need to do is build a well balanced scene
graph and the OSG will cull it efficiently.

Building an efficient scene graph is the task you need to focus on,
this topic is a huge one so I'd recommend spending some time looking
through the archives on the topic and also reading the OSG books.

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


Re: [osg-users] Can we add Viewer::setSkipCloseWindowEvent to prevent Window from being closed upon receiving CLOSE_WINDOW?

2012-10-25 Thread Robert Osfield
HI Micahel,

Are you talking about the following code in Viewer::eventTraversal()
that responds to the osgGA::GUIEventAdapter::CLOSE_WINDOW event?

for(itr = gw_events.begin();
itr != gw_events.end();
++itr)
{
osgGA::GUIEventAdapter* event = itr-get();
switch(event-getEventType())
{
case(osgGA::GUIEventAdapter::CLOSE_WINDOW):
{
bool wasThreading = areThreadsRunning();
if (wasThreading) stopThreading();

gw-close();
_currentContext = NULL;

if (wasThreading) startThreading();

break;
}
default:
break;
}
}

It would be possible to make this optional, in the same way the
EscapeSetsDone flag is used.  Without any modifications to the OSG the
way to avoid the issue would be to subclass from Viewer and override
the eventTraversal() method.

Robert.

On 19 October 2012 13:36, michael kapelko korn...@gmail.com wrote:
 Hi.
 I've looked at the code (OSG 3.0.1) of Viewer::eventTraversal and
 noticed that it checks for CLOSE_WINDOW event and closes the window,
 so there's no way to prevent the window from closing. I've googled for
 window close prevention with no luck, too.
 Can we add something like Viewer::setSkipCloseWindowEvent to OSG?
 Thanks.
 ___
 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] copying contents of osg::Group to rendered Group

2012-10-25 Thread Robert Osfield
Hi Joe,

I can't say what might be wrong with the implementation you are using
given the details provided.  In general sharing and cloning the scene
graph is easy and well established - it's been supported for a decade
now, so in principle trying to do what you are doing should be
possible.  However, what you describe is a pretty usually, perhaps I'd
even say odd, thing to do with the scene graph.

Could you back up a little a explain what you are trying to achieve
and why, rather than the low level description of something you've
implemented not doing with you expect.  With this understanding
perhaps others will be able to suggest how to solve the actual task
you are tackling in a more appropriate way.

Robert.

On 19 October 2012 16:08, Joe Doob cstat...@gmail.com wrote:
 Hi all.

 I have two osg::Groups, one which is being rendered in my viewer and another 
 which is used as a buffer that collects geodes as they are created.

 Periodically, I want to flush the contents of my root group and copy over all 
 the contents in the buffer.

 I have tried several methods of copying the contents of the buffer group to 
 the root group, but I never actually see the new contents appear in my view. 
 Specifically I have tried looping over all children in the buffer and calling 
 root-addChild on each of these. I have also tried assigning the root to a 
 deep copy clone of the buffer. In both cases I can verify that the root 
 contains the data in the buffer using getNumChildren(), but they never show 
 up.

 Does anyone know why this would be? Or, am I just going about this the wrong 
 way?

 Thanks,
 S

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





 ___
 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] osgFX::Registry::Proxy proxy

2012-10-25 Thread Robert Osfield
Hi Peterakos,

On 19 October 2012 17:02, Peterakos hay...@gmail.com wrote:
 What osgFX::Registry::Proxy proxy(new MyEffect); does ?
 Couldnt find any reference anywhere. i see it is used in predefined Effects
 like Outline.

The Proxy will be a static object that is constructed at start up that
registers the effect with the osgFX::Registry.

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


Re: [osg-users] Can OSG store materials externally for an object?

2012-10-25 Thread Robert Osfield
Hi Michael,

On 20 October 2012 09:59, michael kapelko korn...@gmail.com wrote:
 Does OSG have some sort of material files that can be applied to the same 
 mesh?
 So far I've looked into osgt files and they store both mesh and
 material inside one file.

The OSG doesn't have a specific material file, and there isn't a
formal material concept in the OSG.  The closest equivilant is the
OSG mapping to OpenGL state that is encapsulated on osg::StateSet.  I
guess you could write an an osg::StateSet to ascii file and read this
back in using the osgDB::writeObjectFile(..) and
osgDB::readObjectFile(..) functions.

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


Re: [osg-users] Projective Multi-Texturing

2012-10-25 Thread Robert Osfield
Hi Chirstoph,

I'm surprised by you not getting any replies, guess everyone has been
busy, or perhaps confused by what you are after.

It sounds like to me you just need to use the OSG's standard
multi-texturing support, the OSG will manage handling of OpenGL
versions/extensions for you so you won't need to worry about the
OpenGL backend.  All modern OpenGL hardware supports multi-texturing
with the fixed function pipeline and with GLSL shaders, with GLSL you
have greater flexibility and range of units that you can use.

How many textures do you want to assign to a single mesh?

W.r.t projective texturing examples have a look the OSG's osg::TexGen
(which wraps up glTexGen), osg::TexGenNode and the examples that use
TexGen.

~/OpenSceneGraph/examples$ grep TexGen */* -l
osgcubemap/osgcubemap.cpp
osgmultitexture/osgmultitexture.cpp
osgoit/osgoit.cpp
osgprerendercubemap/osgprerendercubemap.cpp
osgspotlight/osgspotlight.cpp
osgteapot/osgteapot.cpp
osgtexture1D/osgtexture1D.cpp
osgtexture3D/osgtexture3D.cpp
osgtexturecompression/osgtexturecompression.cpp
osgvertexprogram/osgvertexprogram.cpp
osgvirtualprogram/CreateAdvancedHierachy.cpp
osgvirtualprogram/CreateSimpleHierachy.cpp
osgvirtualprogram/osgvirtualprogram.cpp
osgvolume/osgvolume.cpp

Robert.

On 21 October 2012 12:17, Christoph Heindl christoph.hei...@gmail.com wrote:
 Dear list members and OSG - Team,

 thank you for all the past and current efforts put into OpenSceneGraph! All
 of my colleagues (including myself) enjoy using your product on a daily
 basis.

 Currently, we are working on supporting texturing for product called
 ReconstructMe (real-time 3d reconstruction). Basically what we'd like to
 achieve is to use photos to texture a mesh. Our current state of development
 allows us to generate UV coordinates for a single triangle mesh for each
 photo (incorporates estimating camera position relative to mesh, determining
 visible triangles, etc.).

 What we'd like to do next is to visualize the textured mesh. Since we are
 all computer vision guys, we lack experience in computer graphics. Before
 heading in the wrong direction, I'd wanted to discuss possible ways to
 implement the visualization step with experts on this list.

 After a bit of research I stumbled upon the following approaches to
 multi-texturing
  - using ARB_multitexture extension. Seems to be limited by available
 hardware units.
  - using GPU multitexturing using separate texture units. Also limited by
 available texture units on hardware
  - using multi-pass rendering. Probably slower but not limited by hardware.

 Question 1: Is there a way to generically supply the textures and UV
 coordinate sets and let OSG choose the best rendering technique from the
 list above?

 Question 2: If not, how would I go about list item number 2 and 3? Are there
 any samples around?

 Question 3: Since each photo covers only a portion of the mesh, I guess we
 need to set texture coordinates for non-textured vertices to be outside of
 the valid UV range (e.g. -1) and set a black-transparent border color? How
 would one combine the textures in a such a way that either only the first
 valid texture is applied to the mesh for any given triangle?

 Thanks in advance,
 Christoph

 ___
 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] Using the notification API with multi-threading - heap corruption errors

2012-10-25 Thread Robert Osfield
Hi Toben,

On 19 October 2012 22:56, Torben Dannhauer tor...@dannhauer.info wrote:
 What is the current status of this issue?

 Currently I'm working with openthreads and learn a lot, but as the 
 threadstartedreported,
 the application crashes more or less frequently if I use the notify macro 
 heavily.

There several changes to the OSG in svn/trunk to help improve thread
safety, but in the end some implementations of ostream aren't thread
safe so you may need to implement your own NotifyHandler that uses a
mutex to serialize the notify calls.

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


Re: [osg-users] Problem with picking a manipulator in a HUD

2012-10-25 Thread Robert Osfield
Hi Kristofer,

On 19 October 2012 13:17, Kristofer Tingdahl
kristofer.tingd...@dgbes.com wrote:
 I am trying to get a Dragger on my HUD display, but I am not able to
 manipulate it at all. If I add it the identical dragger to the normal scene,
 it works as expected. Any insight in this is appreciated as I have reached
 the end of trying to traverse the scene trying to gain understanding in this
 matter.

I am just setting up Qt on my dev machine - I installed an new disk
and OS but didn't pull in all extenal dependencies right away.
Getting there though...  Once I have Qt dev libs and headers installed
I test out your example and have a look what might be going on.

Without actual testing I can't say what might be amiss, I know that
osgManipulator was original written for a 3D perspective window so
perhaps there are assumption that don't map across. In principle I
can't see a reason why using an orthographic view should prevent
manipualtors from working, so if they don't this would be a
bug/implementation limitation that should be addressed.

As a nearly a week has passed since you posted you query, have you
made any progress with understanding the issue at your end?

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


Re: [osg-users] How to copy an FBO used as RTT target ?

2012-10-25 Thread Robert Osfield
Hi Auelien,

When you say input, is it simply that you want to initialize the
contents of the Camera 2's colour and depth buffers with the Camera
1's colour and depth buffers?

If so then one would typically just render the quad with the Camera 1
colour and depth buffers attached as textures and use a fragment
shader to set the colour and depth buffers.  I guess one might be able
to use an OpenGL extension to blit the contents as well, but I haven't
personally done this myself.

Robert.

On 22 October 2012 16:52, Aurelien Albert aurelien.alb...@alyotech.fr wrote:
 Hi,

 I have a scene graph with multiple cameras as follow :

 Camera 1 :
  - clear mask : color and depth
  - use FBO_Camera_1_Color as color buffer attachment
  - use FBO_Camera_1_Depth as depth buffer attachment

 Camera 2 :
  - clear mask : none
  - use FBO_Camera_2_Color as color buffer attachment
  - use FBO_Camera_2_Depth as depth buffer attachment


 Now, I would like the Camera 2 :
  - to use FBO_Camera_1_Color as an INPUT color buffer (do not write into 
 this buffer, write into FBO_Camera_2_Color)
  - to use FBO_Camera_1_Depth as an INPUT depth buffer (do not write into 
 this buffer, write into FBO_Camera_2_Depth)

 So this way :
  - FBO_Camera_1_Color and FBO_Camera_1_Depth remains intact even after 
 camera 2 rendering.
  - everywhere the camera 2 do not write data, data from camera 1 are visible

 The first solution would probably to copy FBOs before camera 2 rendering :
  - FBO_Camera_1_Color into FBO_Camera_2_Color
  - FBO_Camera_1_Depth into FBO_Camera_2_Depth

 How to do that ? Should I use another camera and a renderquad to perform the 
 copy, or is there any OSG functionnality to copy FBO ?


 Even better, is there a second solution to provide an input buffer 
 attachement to a camera ?


 Thank you!

 Aurelien

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





 ___
 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] LineSegmentIntersector gives incorrect results (intersections missing)

2012-10-25 Thread Robert Osfield
HI Peter,

I'm afraid I've not got enough time available to look into this
problem right now, hopefully others can dive in.  My suspicision is
that due to nuermical precision issues on constructing the linesegment
and/or intersecting this with the bonding volumes or meshes you aren't
always getting the intersections you expect.  A quick hack to test
this would be to rotate the mesh slightly so nothing is axis aligned -
this way the mesh won't be setting on the face of the bounding volume.
 If this hack does prove to address the problem then it points the
need of doing interesection testing with error bars that are larger
than the numberic precision errors.

Robert.

On 23 October 2012 09:21, Peter Bako osgfo...@tevs.eu wrote:
 I use the LineSegmentIntersector in my application to select planar faces. 
 The problem is that sometimes when I click on the face facing to you (check 
 the red Xes on the picture), I get no intersection of this face. I get only 
 an intersection on the face which is not visible from this view - the 
 bottom face.
 Then sometimes it happens, that the user wants to select a face, but an 
 invisible face is selected instead, but he doesn't know it because he 
 doesn't see it, even if its highlighted.

 i made this sample application to simulate my problem - when I click on the 
 positions where the red crosses are, normally I should get 2 intersections - 
 first the face where I drew the red crosses and then to bottom face which we 
 don't see. Sometimes, I get only the second (see the debug output on the 
 picture).

 I think this is a problem.

 Thank you!

 Cheers,
 Peter

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





 ___
 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] Custom CullingVisitor

2012-10-25 Thread Robert Osfield
Hi Aurelien,

Writing custom cull visitor is very unusual, and I think your request
for using different cull visitors into two different views might be a
first :-)

To implement I think the only way right now would be to get the
osgView::Renderer from the osg::Camera, then from this get the
osgUtil::SceneView, and then assign your own CullVisitor to the
SceneView.

Robert.

On 24 October 2012 11:02, Aurelien Albert aurelien.alb...@alyotech.fr wrote:
 Hi,

 In my application, I use a custom CullVisitor, this way :

 osgUtil::CullVisitor::prototype() = new MyCustomCullVisitor();

 But this affects all viewers in my application.

 Is there anyway to explicitly set a custom CullVisitor on a specific 
 osgViewer::Viewer ?

 I would like to use twos different CullVisitor for two different viewers.

 Thank you!

 Cheers,
 Aurelien

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





 ___
 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] Uniform arrays not working for me using Visual Studio 2010

2012-10-25 Thread Robert Osfield
Hi David,

I don't personally use Windows, it must a decade now since I last used
one for development... so I can't answer your question specifically.
Best I can do is say in general OpenGL releated features not working
across different systems is usually down to either a problem with the
driver/hardware or a problem in the portability of the OpenGL being
used.  Something shaders might be permitted by one driver but cause a
problem in an another, but the problem can be traced back to use of
OpenGL (shders in particular) in ways that are at edge of the official
GLSL spec.  This type of problem isn't usually affected by compilers
used.

I recall a tweak made to the OSG to address percularities in driver
implementations in the OSG-3.x era, but can't recall the specific
dates, perhaps this fix might address the problems you have.  Could
you try out the svn/trunk or OSG-3.1.3 dev release?

Robert.

On 24 October 2012 16:17, David Sellin davse...@student.liu.se wrote:
 Hi,

 I ported my program from mingw and Code Blocks to Visual Studio 2010 Express 
 and found that I couldn't get uniform arrays to work. Has anyone experienced 
 this? I'm new to Visual Studio so I might have missed something.

 I made a small test program that works on my old system but not on my new 
 system:
 (sorry for the weird symbols and that the include dirs fell off)


 Code:

 #include osg/Group
 #include osgDB/ReadFile
 #include osgViewer/Viewer
 #include osgGA/TrackballManipulator

 int main( int argc, char **argv )
 {
 osg::setNotifyLevel( osg::WARN );

 osg::Group *root = new osg::Group;

 std::string url = cow.osg;
 osg::Node* modelNode = osgDB::readNodeFile( url );

 //setup shaders
 osg::Shader *vertshader = new osg::Shader( osg::Shader::VERTEX );
 vertshader-loadShaderSourceFromFile( uniformarray.vert );
 osg::Shader *fragshader = new osg::Shader( osg::Shader::FRAGMENT );
 fragshader-loadShaderSourceFromFile( uniformarray.frag );
 osg::Program *shaderprog = new osg::Program();
 shaderprog-addShader( vertshader );
 shaderprog-addShader( fragshader );
 modelNode-getOrCreateStateSet()-setAttributeAndModes( shaderprog );

 // Array uniform
 osg::Uniform *arrayUFM = new osg::Uniform( osg::Uniform::FLOAT, array, 
 2 );
 arrayUFM-setElement( 0, 0.5f );
 arrayUFM-setElement( 1, 1.0f );
 modelNode-getOrCreateStateSet()-addUniform( arrayUFM );

 root-addChild( modelNode );

 // Graphics Context and Traits
 osg::ref_ptrosg::GraphicsContext::Traits traits = new 
 osg::GraphicsContext::Traits;
 traits-x = 10;
 traits-y = 10;
 traits-width = 800;
 traits-height = 600;
 traits-doubleBuffer = true;
 const std::string version( 3.1 );
 traits-glContextVersion = version;

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

 // Viewer
 osg::ref_ptrosgViewer::Viewer viewer = new osgViewer::Viewer();
 viewer-getCamera()-setGraphicsContext( gc.get() );
 viewer-getCamera()-setViewport( new osg::Viewport( 0, 0, traits-width, 
 traits-height ) );
 viewer-setSceneData( root );
 viewer-setCameraManipulator( new osgGA::TrackballManipulator() );

 viewer-run();

 return 0;
 }




 Vertex shader:

 Code:

 #version 140

 uniform mat4 osg_ModelViewProjectionMatrix;

 in vec4 osg_Vertex;

 void main()
 {
   gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
 };




 Fragment shader using the array:

 Code:

 #version 140

 uniform float array[2];

 out vec4 fragData;

 void main()
 {
   fragData = vec4( 1.0, array[0], array[1], 1.0 );
 }




 Old system:
 OSG 3.0 (revision 12753)
 MinGW and Code Blocks
 NVIDIA GEFORCE 260
 WIN 7

 New system
 OSG 3.0.1 (stable release)
 Visual C++ 2010 Express
 NVIDIA GEFORCE 680
 WIN 7

 Thank you!

 Cheers,
 David[/code]

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





 ___
 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] Rotation animation

2012-10-25 Thread Robert Osfield
Hi Hector,

There several ways of achiving what you want, one could precompute all
the positions and put them into an osg::AnimationPath and attach this
via an osg::AnimationPathCallback to a transform above the subgraph
you want to move - see the osganimation example, or write your own
update callback that computes the position on the fly for each new
frame.  Perhaps I'd go for the callback approach.

Robert.

On 25 October 2012 08:22, Héctor Martínez hector.marti...@sensetrix.com wrote:
 Hi,



 I am trying to make an animation to one model. What I want is to rotate the
 model around its own axis and also to translate (rotation again) around
 another pivot point, like Earth movements. I can achieve both movements
 separately, but I don’t know how to make both animations work at the same
 time. I have tried nesting animations and similar ideas, but without luck.



 Could somebody give me some clues to get the solution to my problem?



 Thank you in advance,



 Best regards


 ___
 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] Problem with picking a manipulator in a HUD

2012-10-25 Thread Robert Osfield
Hi Kristofer,

I have just tested your cube.cpp and see the problem with being able
move the hud layer.  I haven't drilled down into the code yet but I
strongly suspect the issue is nesting a HUD Camera in the scene graph
and how an intersection traversal will handle this case.   My own
inclination would be to place a HUD layer as a slave Camera in the
viewer or use a CompositeViewer with a View for the 3D view and View
for the HUD layer.  This way the intersections can happen indepdently
for each View/Camera from the top and less likely to conflict.

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


Re: [osg-users] Can we add Viewer::setSkipCloseWindowEvent to prevent Window from being closed upon receiving CLOSE_WINDOW?

2012-10-25 Thread michael kapelko
Should I create the patch for the functionality?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Open Asset Import Library

2012-10-25 Thread michael kapelko
Wang Rui, I research what format best to use for moving objects from
Blender to OSG, and I see Assimp claiming to load Blender files
directly. Since you said you wrote the plug-in already for it, I'd
like to try it out.
I have a follow up question: can I possibly differentiate Blender
model from Blender material to have several skins for the same
material in OSG? Does your plug-in do anything of the sort?
Thanks.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Open Asset Import Library

2012-10-25 Thread michael kapelko
For the same *object. Sorry.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Rotation animation

2012-10-25 Thread Héctor Martínez
Hi Robert,

thank you for your answer. I was using osg::AnimationPath for individual
animations, but when trying to combine both animations the behaviour is not
the desired. The problem is that I want to change dynamically the pivot
point of the translation animation. In other words, the rotation has to be
always the same (centered in the model), and it has also to translate around
a dynamic pivot point. If I do this separately, it works. But if I add both
animations using addUpdateCallback, only the translation is working.

I am a bit lost in the animationpath concept. Is it possible to add 2
animationpaths to the same PositionAttitudeTransform?

Thank you.

Best regards

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: jueves, 25 de octubre de 2012 13:06
To: OpenSceneGraph Users
Subject: Re: [osg-users] Rotation animation

Hi Hector,

There several ways of achiving what you want, one could precompute all the
positions and put them into an osg::AnimationPath and attach this via an
osg::AnimationPathCallback to a transform above the subgraph you want to
move - see the osganimation example, or write your own update callback that
computes the position on the fly for each new frame.  Perhaps I'd go for the
callback approach.

Robert.

On 25 October 2012 08:22, Héctor Martínez hector.marti...@sensetrix.com
wrote:
 Hi,



 I am trying to make an animation to one model. What I want is to 
 rotate the model around its own axis and also to translate (rotation 
 again) around another pivot point, like Earth movements. I can achieve 
 both movements separately, but I don’t know how to make both 
 animations work at the same time. I have tried nesting animations and
similar ideas, but without luck.



 Could somebody give me some clues to get the solution to my problem?



 Thank you in advance,



 Best regards


 ___
 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] Can we add Viewer::setSkipCloseWindowEvent to prevent Window from being closed upon receiving CLOSE_WINDOW?

2012-10-25 Thread Robert Osfield
Hi Mcahel,

On 25 October 2012 12:04, michael kapelko korn...@gmail.com wrote:
 Should I create the patch for the functionality?

The question is how one might go about the patch.  One could modify
ViewerBase to add g/setIgnoneCloseEvent(bool)  and then read this in
Viewer/CompositeViewer::eventTraversals() method, or go about it at
the GraphicsWindow level by creating a window that doesn't have a
close button.  Is there a reason why you aren't doing the later?

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


Re: [osg-users] Rotation animation

2012-10-25 Thread Robert Osfield
Hi Héctor,

On 25 October 2012 12:34, Héctor Martínez hector.marti...@sensetrix.com wrote:
 thank you for your answer. I was using osg::AnimationPath for individual
 animations, but when trying to combine both animations the behaviour is not
 the desired. The problem is that I want to change dynamically the pivot
 point of the translation animation. In other words, the rotation has to be
 always the same (centered in the model), and it has also to translate around
 a dynamic pivot point. If I do this separately, it works. But if I add both
 animations using addUpdateCallback, only the translation is working.

 I am a bit lost in the animationpath concept. Is it possible to add 2
 animationpaths to the same PositionAttitudeTransform?


The AnimationPathCallback doesn't support attached two AnimationPath.
One could write your callback that does this but you'd need to make
sure that local and transform origins are all consistent.

As I said in my previous email I'd recommend using your own custom
UpdateCallback.  This way you can compute the path exactly for each
frame as per your requirements.

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


Re: [osg-users] Rotation animation

2012-10-25 Thread Héctor Martínez
Hi Robert,

thank you again.

Then it seems that the only way to concatenate animations is by creating a
custom UpdateCallback, right? Do you know any example about this that could
help me to develop my own callback?

I have also two more questions about animation:

- What is the addNestedCallback function used for?
- Is it possible to have different animations attached to the same node and
play only one at a time?

Best regards

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: jueves, 25 de octubre de 2012 15:16
To: OpenSceneGraph Users
Subject: Re: [osg-users] Rotation animation

Hi Héctor,

On 25 October 2012 12:34, Héctor Martínez hector.marti...@sensetrix.com
wrote:
 thank you for your answer. I was using osg::AnimationPath for 
 individual animations, but when trying to combine both animations the 
 behaviour is not the desired. The problem is that I want to change 
 dynamically the pivot point of the translation animation. In other 
 words, the rotation has to be always the same (centered in the model), 
 and it has also to translate around a dynamic pivot point. If I do 
 this separately, it works. But if I add both animations using
addUpdateCallback, only the translation is working.

 I am a bit lost in the animationpath concept. Is it possible to add 2 
 animationpaths to the same PositionAttitudeTransform?


The AnimationPathCallback doesn't support attached two AnimationPath.
One could write your callback that does this but you'd need to make sure
that local and transform origins are all consistent.

As I said in my previous email I'd recommend using your own custom
UpdateCallback.  This way you can compute the path exactly for each frame as
per your requirements.

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


Re: [osg-users] Can we add Viewer::setSkipCloseWindowEvent to prevent Window from being closed upon receiving CLOSE_WINDOW?

2012-10-25 Thread michael kapelko
Well, something like Alt-F4 is very-very intuitive, so forbidding it
will increase the number of angry people :)
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Rotation animation

2012-10-25 Thread Robert Osfield
Hi Héctor,

On 25 October 2012 13:35, Héctor Martínez hector.marti...@sensetrix.com wrote:
 Then it seems that the only way to concatenate animations is by creating a
 custom UpdateCallback, right? Do you know any example about this that could
 help me to develop my own callback?

You can nest transform nodes and attach a seperate callback to each
one, but this may well not be what you are after.  concatenate
animations is such an open ended term that only you really know what
you are after.

 I have also two more questions about animation:

 - What is the addNestedCallback function used for?

The OSG doesn't use a concept of pre and post traversal callbacks for
each of the different traversal but instead uses a scheme where
multiple callbacks can be nested within each other.  The advantage of
this approach is that it makes it much easier to manage local state in
a thread safe way and to control traversal.

 - Is it possible to have different animations attached to the same node and
 play only one at a time?

The AnimationPathCallback doesn't support this but there is nothing to
stop you from implementing your own callback to do this, or assign
different paths at different times.

Again I'd encourage you to roll your sleves up and code youself a
custon update callback to do the animation exactly the way you need
to.

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


[osg-users] Error when visualizing normals with the pseudo normal loader

2012-10-25 Thread Björn Blissing
Hi,

While trying to debug some odd normals in my generated surface I was using the 
normal pseudo loader with osgviewer to visualize the result.
But I was starting to get a lot of error messages:

CullVisitor::apply(Geode) detected NaN,
depth=-1.#IND, center=(0 0 0),
matrix={
1.#QNAN 1.#QNAN 1.#QNAN 1.#QNAN
1.#QNAN 1.#QNAN 1.#QNAN 1.#QNAN
1.#QNAN 1.#QNAN 1.#QNAN 1.#QNAN
1.#QNAN 1.#QNAN 1.#QNAN 1.#QNAN
}

I tried to reduce the offending dataset to discover what my mistake was, but I 
cannot find my error.

See the attached .osg file for an example of a small part of my geometry but it 
still gives the NaN error in when loading it with the normal pseudo loader:

osgviewer testfile.osg.normals

Do any of you see the error in my geometry?

Best regards
Björn


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


Re: [osg-users] HELP~OSG forAndroid crashed~~~

2012-10-25 Thread Jan Ciger
Hello Houhouh (sorry if that isn't your name, but you didn't provide one
...),

On Thu, Oct 25, 2012 at 10:27 AM, houhouh houh...@163.com wrote:

 10-25 15:57:03.710: INFO/DEBUG(1732): signal 11 (SIGSEGV), code 1
 (SEGV_MAPERR), fault addr 



You haven't provided the ABI you have compiled for, but seeing that your
device has Tegra 2 SoC, I suspect that the crash comes from the lack of
support for the Neon instructions on it. These are similar to the SSE
instructions on x86, unfortunately they are an optional part of the ARM
specification, so not all vendors implement them. Nvidia chose not to and
thus Tegra 2 doesn't have them :( (however, the newer Tegra 3 does, go
figure ...)

You can solve this either by switching to the v5 ABI (armeabi instead of
armeabi-v7a in your Application.mk file) that doesn't use Neon or by
disabling Neon instructions and recompiling OSG again.

I believe this is actually documented in the Android part of the website
too.

Regards,

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


Re: [osg-users] HELP~OSG forAndroid crashed~~~

2012-10-25 Thread Jan Ciger
Hello again,

On Thu, Oct 25, 2012 at 10:27 AM, houhouh houh...@163.com wrote:

 In forums have a similar question ,but it didn't work.
 http://forum.open
 scenegraph.org/viewtopic.php?t=8959postdays=0postorder=aschighlight=androidstart=15
 Did anyone have encountered the similar error~or anyone who can help me to
 solve it~~i test the apk on a samsung pad ,and build the example only for
 armeabi ,unused Neon extensions!Thank you ~


For me what helped to solve this was to recompile *whole OSG*, not only the
example only for armeabi. Unfortunately, the NDK build system is a bit
strange, really fragile and sometimes wrong versions of the libraries gets
picked, so it is possible that it has linked in an incorrect library file.
Also, if you were doing multiple builds with/without Neon, armeabi-v7a,
etc. make sure to use a clean folder for the compilation, to avoid any
stale files.

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


Re: [osg-users] Open Asset Import Library

2012-10-25 Thread Wang Rui
Hi Michael,

AssImp use a simpler scene graph to manage read data, in which one
node could have a transformation matrix and multiple meshes, and
multiple child nodes. Materials (including textures) are managed
globally in a int, pointer map so objects could share one texture.
But one mesh can only be linked to one material. I personally think
Assimp will divide any object into meshes to support multiple
materials if required, but I don't know Blender output would be
handled in similar way in such case.

Wang Rui


2012/10/25 michael kapelko korn...@gmail.com:
 Wang Rui, I research what format best to use for moving objects from
 Blender to OSG, and I see Assimp claiming to load Blender files
 directly. Since you said you wrote the plug-in already for it, I'd
 like to try it out.
 I have a follow up question: can I possibly differentiate Blender
 model from Blender material to have several skins for the same
 material in OSG? Does your plug-in do anything of the sort?
 Thanks.
 ___
 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 Multi-Texturing

2012-10-25 Thread Christoph Heindl
Hi Robert,

On Thu, Oct 25, 2012 at 11:11 AM, Robert Osfield
robert.osfi...@gmail.comwrote:

 Hi Chirstoph,

 I'm surprised by you not getting any replies, guess everyone has been
 busy, or perhaps confused by what you are after.


thanks for your reply. Actually my post seems to show up twice on this list
under the same topic. I think it was my fault, as I did a resend when the
first did not seem to show up.



 It sounds like to me you just need to use the OSG's standard
 multi-texturing support, the OSG will manage handling of OpenGL
 versions/extensions for you so you won't need to worry about the
 OpenGL backend.  All modern OpenGL hardware supports multi-texturing
 with the fixed function pipeline and with GLSL shaders, with GLSL you
 have greater flexibility and range of units that you can use.


Ok, so the fixed function pipeline does already contain an implementation
for multitexturing, in contrast to the programmable pipeline via shaders,
right?




 How many textures do you want to assign to a single mesh?


I would assume that ten fotos should suffice to texture a mesh 95%. I need
to deal with vertices that are textured from multiple fotos or are never
textured somehow on my side. Is there a way (without splitting the mesh) to
assign a default material (simple color) to all untextured
vertices/triangles? I'd assume that I can assign out of range UV
coordinates (-1) and set a border color.

Thanks for your attention.

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


Re: [osg-users] Projective Multi-Texturing

2012-10-25 Thread Christoph Heindl
On Wed, Oct 24, 2012 at 5:30 PM, Jason Daly jd...@ist.ucf.edu wrote:

  On 10/24/2012 03:03 AM, Christoph Heindl wrote:

Ah, yes.  If you want to end up exporting the mesh, then a real-time shader
 might be a problem.  It's not impossible, as there are formats like COLLADA
 that allow you to embed shaders, but from my experience, run-time systems
 don't often fully support those features.


Ok.



 If you do need to export to a static format (like fbx), then I don't see a
 way around splitting the mesh.  If your maximum photo count is 64, there's
 no way you can have all of the textures enabled and statically mapped at
 the same time (that would mean you'd need 64 sets of texture coordinates,
 and no graphics card supports that many vertex attributes).


 I think you'd need to do an initial pass to see which photos cover which
 vertices, then divide up the mesh accordingly.  Only one (maybe two or
 three) textures will need to be active for each patch, which means you'd
 only need at most three sets of texture coordinates for each vertes.  This
 should be exportable to one of several modern formats.  Yes, you'll have
 some duplication of vertices along the boundaries, but this isn't really a
 huge problem.  The vertex processing most likely isn't going to be your
 bottleneck here.


I agree, but I think for further mesh processing duplicate vertices could
be problem (decimation, ...).



 Maybe someone smarter than me can come up with a solution that doesn't
 require splitting the mesh, but I don't see one...


Just one more thought. In my research I found that most modelling software
support UV unwrapping (not sure if it is the right term). What I mean is
that the user marks a seam on the mesh and the mesh is then unfolded along
that seem into individual patches that can be mapped to the UV space. Do
you know how such seams are handled by the rendering engine? It seems
naturally to me that at seems one need to split the mesh and duplicate
vertices.

Best  thanks for your help,
Christoph
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Projective Multi-Texturing

2012-10-25 Thread Robert Osfield
HI Chirstoph,

On 25 October 2012 17:13, Christoph Heindl christoph.hei...@gmail.com wrote:
 Ok, so the fixed function pipeline does already contain an implementation
 for multitexturing, in contrast to the programmable pipeline via shaders,
 right?

Both fixed function and shaders support multi-texturing.  The fixed
function is typically more limited in the number of texture units the
driver exposes, how many units each support is driver and hardware
dependent.

 How many textures do you want to assign to a single mesh?

 I would assume that ten fotos should suffice to texture a mesh 95%.

This might well push you over the limit supported by fixed function
pipeline on your hardware so it's likely you'll need to look at using
GLSL shaders.  As you have a pretty straight forward usage case this
won't require anything too complicated.

  I need
 to deal with vertices that are textured from multiple fotos or are never
 textured somehow on my side. Is there a way (without splitting the mesh) to
 assign a default material (simple color) to all untextured
 vertices/triangles? I'd assume that I can assign out of range UV coordinates
 (-1) and set a border color.

With OpenGL the whole mesh will be textured by all textures you apply,
the way to get non and textured parts for areas outside the texture
coordinate range 0,0 to 1,1 is to set a alpha value of 0 for the
border colour, something like (1,1,1,0) would be appropriate.  However
if you are using GLSL you can use test the texture coordinate prior to
reading the texture and then just blend the colours as you require.

It's not really me place to teach you GLSL so I have to recommend that
you look at online resources for GLSL, and on the OSG side have a look
at the osgshaders example and any other places where osg::Program
crops up in the OSG examples or code base.

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


Re: [osg-users] Projective Multi-Texturing

2012-10-25 Thread Christoph Heindl
Hi Robert,

On Thu, Oct 25, 2012 at 6:26 PM, Robert Osfield

 This might well push you over the limit supported by fixed function
 pipeline on your hardware so it's likely you'll need to look at using
 GLSL shaders.  As you have a pretty straight forward usage case this
 won't require anything too complicated.


Ok thanks



 With OpenGL the whole mesh will be textured by all textures you apply,
 the way to get non and textured parts for areas outside the texture
 coordinate range 0,0 to 1,1 is to set a alpha value of 0 for the
 border colour, something like (1,1,1,0) would be appropriate.  However
 if you are using GLSL you can use test the texture coordinate prior to
 reading the texture and then just blend the colours as you require.


This seems the way to go. Alternatively one could split (i.e duplicate
vertices) the mesh at seams and generate a texture atlas (should be easy
for all the fotos). This should allow me to use one texture.

Multiple approaches, which one to take? ;)



 It's not really me place to teach you GLSL so I have to recommend that
 you look at online resources for GLSL, and on the OSG side have a look
 at the osgshaders example and any other places where osg::Program
 crops up in the OSG examples or code base.


That's ok, I'm thankful for all the input received!

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


Re: [osg-users] Projective Multi-Texturing

2012-10-25 Thread Jason Daly

On 10/25/2012 12:17 PM, Christoph Heindl wrote:


I think you'd need to do an initial pass to see which photos cover
which vertices, then divide up the mesh accordingly.  Only one
(maybe two or three) textures will need to be active for each
patch, which means you'd only need at most three sets of texture
coordinates for each vertes.  This should be exportable to one of
several modern formats.  Yes, you'll have some duplication of
vertices along the boundaries, but this isn't really a huge
problem.  The vertex processing most likely isn't going to be your
bottleneck here.



I agree, but I think for further mesh processing duplicate vertices 
could be problem (decimation, ...).


That's possible.  If you're relying on a single mesh for your decimation 
process, then it could very well present difficulties.  The decision 
will probably have to be based on what combination of techniques 
presents the fewest difficulties  :-)




Maybe someone smarter than me can come up with a solution that
doesn't require splitting the mesh, but I don't see one...


Just one more thought. In my research I found that most modelling 
software support UV unwrapping (not sure if it is the right term). 
What I mean is that the user marks a seam on the mesh and the mesh is 
then unfolded along that seem into individual patches that can be 
mapped to the UV space. Do you know how such seams are handled by the 
rendering engine? It seems naturally to me that at seems one need to 
split the mesh and duplicate vertices.


I'm not a modeler, but I think I've seen the tool you're referring to.  
It's typically used to allow a digital artist to design a texture atlas 
for the specific mesh.  The tool creates a blank texture atlas with 
all of the texture coordinates mapped appropriately, and then the artist 
simply paints the desired imagery onto that blank atlas.  In your 
case, you've already got imagery that you're trying to map onto a mesh, 
so you'd have to warp your photos to fit the texture atlas.  Plus, you 
indicated you'd be needing to blend between textures at the photo 
borders.  With this in mind, I don't know if that tool will be more 
likely to help or hinder you, to be honest.


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


Re: [osg-users] Projective Multi-Texturing

2012-10-25 Thread Glenn Waldron
I would try multipass rendering first. It is likely to be the slowest, but
also probably the easiest to implement and you don't have to worry about
exceeding your hardware limits. This falls into the category of just get
it working and then worry about optimizing it later if necessary. Who
knows -- maybe the performance will be acceptable.

Glenn Waldron / @glennwaldron


On Thu, Oct 25, 2012 at 1:18 PM, Christoph Heindl 
christoph.hei...@gmail.com wrote:

 Hi Robert,

 On Thu, Oct 25, 2012 at 6:26 PM, Robert Osfield

 This might well push you over the limit supported by fixed function
 pipeline on your hardware so it's likely you'll need to look at using
 GLSL shaders.  As you have a pretty straight forward usage case this
 won't require anything too complicated.


 Ok thanks



 With OpenGL the whole mesh will be textured by all textures you apply,
 the way to get non and textured parts for areas outside the texture
 coordinate range 0,0 to 1,1 is to set a alpha value of 0 for the
 border colour, something like (1,1,1,0) would be appropriate.  However
 if you are using GLSL you can use test the texture coordinate prior to
 reading the texture and then just blend the colours as you require.


 This seems the way to go. Alternatively one could split (i.e duplicate
 vertices) the mesh at seams and generate a texture atlas (should be easy
 for all the fotos). This should allow me to use one texture.

 Multiple approaches, which one to take? ;)



 It's not really me place to teach you GLSL so I have to recommend that
 you look at online resources for GLSL, and on the OSG side have a look
 at the osgshaders example and any other places where osg::Program
 crops up in the OSG examples or code base.


 That's ok, I'm thankful for all the input received!

 Best,
 Christoph

 ___
 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] Uniform arrays not working for me using Visual Studio 2010

2012-10-25 Thread Ulrich Hertlein
Hi David,

On 25/10/12 2:17, David Sellin wrote:
 I ported my program from mingw and Code Blocks to Visual Studio 2010 Express 
 and found
 that I couldn't get uniform arrays to work. Has anyone experienced this? I'm 
 new to Visual
 Studio so I might have missed something.
...
 Old system:
 OSG 3.0 (revision 12753)
 MinGW and Code Blocks
...
 
 New system
 OSG 3.0.1 (stable release)
 Visual C++ 2010 Express
...

What's the error?
Did you check that it's not the usual debug vs. release libraries issue?
(I'm feeling like a parrot right now.)

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