Re: [osg-users] osgmultiplerendertargets

2008-09-04 Thread J.P. Delport

Hi,

no, you don't need cmline args. With just the command you should see a 
yellow square.


I have not compiled 2.6. I have 2.5.3 here and it works (Debian Sid, 
NVidia 7400 Go).


You could also try:
osgmultiplerendertargets --image
and
osgmultiplerendertargets --hdr

but they prob won't work if the simple one does not.

I know there have been some changes wrt multisample FBO's, not sure if 
that could cause trouble.


I'm also not sure if there are proper checking for MRT capabilities in 
the example. The example assumes it can use 4 render targets.


jp

[EMAIL PROTECTED] wrote:

I'm getting a segmentation fault when running the osgmultiplerendertargets 
example using OSG 2.6 under Linux.The call stack says its in 
RenderStage::runCameraSetUp. My OSG isn't currently compiled debug. Am I doing 
something wrong? Do I need command line arguments?

Paul P


  
___

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



--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] Linking error : OpenThread

2008-09-04 Thread Mathias Fröhlich

Hi,

On Thursday 04 September 2008 23:23, Rahul Jain wrote:
> While compiling my application with OSG2.6 I am getting following
> linking error  "*undefined reference to
> `OpenThreads::Atomic::operator--()*". The same application is linked
> properly with OSG2.4.  Since i am not using Atomic operation in my
> application, i  am not able to find the reason for failure.Any guesses ?

May be you need to link your application to libOpenThreads also?
You use the Atomic stuff when you have any ref_ptr inline in your code ...

Greetings

Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Florian Geyer,
Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Prof. Dr. Hanns Ruder
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


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


[osg-users] VPB using shoreline / borders vector data to determine alpha

2008-09-04 Thread Ralf Stokholm
Hi Robert /List

Would an option to use a shapefile containing ie. water bodies or borders to
set the transparency of a terrain layer be feaseble?

For my application it would be nice to use border vector data to eleminate
data from one dataset and blend into another.

It should also be relatively easy to extend a terrain with some nice looking
ocean effects if the terrain would simply alphablen into the warter surface
as determined by a shoreline shapefile?

What are your thourghts on this?

Brgs.

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


[osg-users] how to create char fireworks

2008-09-04 Thread xuyuanzhen1
Hello all:
  I want to create some char fireworks such as osgCool.osg.Who could tell 
me how to do or have any examples?
  Any help shall be appreciated.
  Best wishes.

2008-09-05 



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


Re: [osg-users] playing AVI on Windows

2008-09-04 Thread Ulrich Hertlein
Hi Janusz,

Janusz wrote:
> To play AVI from within OSG, I wrote a simple app. that plays (or should
> play) AVI files in OSG. The app. proceeds frame by frame displaying the
> AVI contents on a quad inside OSG.
> My problem is that only the first frame is generated and shown on the
> quad. As soon as the app. steps to another one, it breaks.
>...
> /* Code where it breaks: Image.cpp
> void Image::deallocateData()
> {
> if (_data) {
> if (_allocationMode==USE_NEW_DELETE) delete [] _data;
> else if (_allocationMode==USE_MALLOC_FREE) ::free(_data);
> _data = 0;
> }
> }
>... 
> hBitmap = CreateDIBSection (hdc, (BITMAPINFO*)(&bmih),
> DIB_RGB_COLORS, (void**)(&data), NULL, NULL);
>...
> image->setImage(imWidth,imHeight,1,
> GL_TEXTURE_2D,GL_RGB,
> GL_UNSIGNED_BYTE, data,
> osg::Image::USE_NEW_DELETE);
>...
> image->allocateImage(256, 256, 1,
> GL_RGB, GL_UNSIGNED_BYTE);

Your 'data' object is allocated by 'CreateDIBSection'.  You then pass it to 
osg::Image and
tell it to USE_NEW_DELETE to free the pointer if necessary.

When you call osg::Image::allocateImage the first thing it does is to try to 
get rid of
the previous image, in your case it does a 'delete[] data'.  This is probably 
the wrong
thing for two reasons: first 'data' mosty likely wasn't allocated using 'new[]' 
and second
you don't actually want to delete that data.

You don't actually need to tell the image anything other than that the contents 
of 'data'
has changed (I assume this is the case in 'GrabAVIFrame').

Try to use osg::Image::NO_DELETE instead of osg::Image::USE_NEW_DELETE and 
simply call
osg::Image::dirty() after your call to 'GrabAVIFrame' (no 
allocateImage/setImage).  The
dirty() call marks the Image data as modified and causes the Texture to 
re-upload it.

Hope this helps.
Cheers,
/ulrich
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Movie texture on poly

2008-09-04 Thread Patrick A. Webb

Hello, I'm trying to use osgviewer to display some models created in
Blender, and use animated textures (MPEG4 movies or even animated GIFs) on
those models.

I've read through the archives and found mention of replacing the texture
file name in the .osg file with the name of the movie that's going to be 
the animated texture, but I've had no luck getting the texture to actually

animate.

Does anyone have an example .osg file and an associated movie that 
worktogether to play an animated texture on a polygon?


Thanks in advance for any help.

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


Re: [osg-users] 2.6 Mac OS X issues and some solutions

2008-09-04 Thread Dongpyo Hong
Hi,

I also had strange experience on Mac OS X (10.5) MacBook Pro
when I ran an OSG application (specificially osgShadow), my MBP
rebooted. I just suspect Video card of my MBP (ATI Radeon).
Anyone who has similar experience with me or can explain why?

Cheers,
Dongpyo

On 9/4/08, James Turner <[EMAIL PROTECTED]> wrote:
>
>
> On 4 Sep 2008, at 14:34, Eric Sokolowsky wrote:
>
> Yes, for now, the cmake project does not create OSG frameworks. We're
>> working on this. Creating dylibs works fine. These dylibs can be installed
>> on a developer's system or embedded into an application. Since most of the
>> example programs require command-line arguments to run properly, it's not
>> too much of a burden to set environment variables. Once we get frameworks
>> built with cmake the environment variables should not be necessary.
>>
>
> I'd be happy to test any work-in-progress on building frameworks for CMake
> - and since OSG is currently 'unstable' it'd seem like a good time to get in
> into SVN so people can try it and work through and problems that arise.
>
> James
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
===
Dongpyo Hong, Research Assistant
500-712 Oryong-dong Buk-gu Gwangju, Korea
GIST U-VR Lab http://uvr.gist.ac.kr
http://uvr.gist.ac.kr/~dhong
e-mail: [EMAIL PROTECTED]
Tel: +82-62-970-3157 (2279)
Fax: +82-62-970-2204
===
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] playing AVI on Windows

2008-09-04 Thread Janusz

Dear all:

To play AVI from within OSG, I wrote a simple app. that plays (or should 
play) AVI files in OSG. The app. proceeds frame by frame displaying the 
AVI contents on a quad inside OSG.
My problem is that only the first frame is generated and shown on the 
quad. As soon as the app. steps to another one, it breaks.


Shortly speaking, my sequence is as follows:

- open avi file, stream
- get the first frame
- create the quad, and apply the texture // so far, so good!
- init viewer
loop:
   increase frame count
   grab the bext frame
   apply the texture // frame no. 2 - crash
   
end

It is inside the viewer's loop that the code breaks when I apply the AVI 
data (at frame no. 2) to the new image through:

   while (!viewer.done())
   {   
   viewer.frame();   


   frame = ((frame+1)>lastframe) ? 0 : (frame+1);

   GrabAVIFrame(frame);
  
   image->allocateImage(256, 256, 1,

   GL_RGB, GL_UNSIGNED_BYTE);
   // BREAKS HERE
   image->setImage(256,256,1,
   GL_TEXTURE_2D,GL_RGB,
   GL_UNSIGNED_BYTE, data,
   osg::Image::USE_NEW_DELETE);
   texture->setImage(0,image.get());   
  
   }


I have tracked the error down to deallocateData() in Image.cpp. I would 
appreciate any advice on how to solve this. The source code that 
recreates the error in a simple way is below.


The AVI part comes from the NeHe site.
Again, appreciate any reply on the cause of the problem here.
Rgds, Janusz

-
/* Code where it breaks: Image.cpp

void Image::deallocateData()
{
   if (_data) {
   if (_allocationMode==USE_NEW_DELETE) delete [] _data;
   else if (_allocationMode==USE_MALLOC_FREE) ::free(_data);
   _data = 0;
   }
}

*/

#include 

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include 
#include 
#include 
#include 

#include 
#include 
#include 
#include 

#include 

#pragma comment( lib, "vfw32.lib" )   


intframe=0;
AVISTREAMINFO psi;
PAVISTREAMpavi;
PGETFRAMEpgf;

BITMAPINFOHEADER bmih;
long lastframe;
int width;
int height;

char *pdata;

HDRAWDIB hdd;   
HBITMAP hBitmap;   
HDC hdc = CreateCompatibleDC(0);   
unsigned char* data = 0;

int mpf;

osg::ref_ptr texture;
osg::ref_ptr image;

// Flips The Red And Blue Bytes (256x256)
void flipIt(void* buffer)   
{
   void* b = buffer;   
   __asm   
   {
   mov ecx, 256*256   
   mov ebx, b   
label:   
   mov al,[ebx+0]   
   mov ah,[ebx+2]   
   mov [ebx+2],al   
   mov [ebx+0],ah   

   add ebx,3   
   dec ecx   
   jnz label   
   }

}

void OpenAVI(LPCSTR szFile)   
{
   AVIFileInit();   
   hdd = DrawDibOpen();
  
   // Opens The AVI Stream
   if (AVIStreamOpenFromFile(&pavi, szFile, streamtypeVIDEO, 0, 
OF_READ, NULL) !=0)

   {
   MessageBox (HWND_DESKTOP, "Failed To Open The AVI Stream", 
"Error", MB_OK | MB_ICONEXCLAMATION);

   }

   AVIStreamInfo(pavi, &psi, sizeof(psi));   
   width=psi.rcFrame.right-psi.rcFrame.left;   
   height=psi.rcFrame.bottom-psi.rcFrame.top;   
   lastframe=AVIStreamLength(pavi);   

   mpf=AVIStreamSampleToTime(pavi,lastframe)/lastframe;   

   bmih.biSize = sizeof (BITMAPINFOHEADER);   
   bmih.biPlanes = 1;   
   bmih.biBitCount = 24;   
   bmih.biWidth = 256;   
   bmih.biHeight = 256;
  

   hBitmap = CreateDIBSection (hdc, (BITMAPINFO*)(&bmih), 
DIB_RGB_COLORS, (void**)(&data), NULL, NULL);
   SelectObject (hdc, hBitmap);   

   pgf=AVIStreamGetFrameOpen(pavi, NULL);   
   if (pgf==NULL)

   {
   MessageBox (HWND_DESKTOP, "Failed To Open The AVI Frame", 
"Error", MB_OK | MB_ICONEXCLAMATION);
   }   
}


void GrabAVIFrame(int frame)   
{
   LPBITMAPINFOHEADER lpbi;   
   lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(pgf, frame);   
   pdata=(char *)lpbi+lpbi->biSize+lpbi->biClrUsed * sizeof(RGBQUAD);
  
   DrawDibDraw (hdd, hdc, 0, 0, 256, 256, lpbi, pdata, 0, 0, width, 
height, 0);
  
   flipIt(dat

[osg-users] osgFX::BumpMapping

2008-09-04 Thread Pecoraro, Alexander N
Is it possible to write osgFX::BumpMapping nodes to an ive file? I
noticed in OSG 2.4 and 2.5 there seems to be some code for writing it to
.osg, but not .ive. I also noticed that in the OSG trunk on SVN there
appears to be some code for writing it to ive, but I was hoping to be
able to use a released version. I figured since it appears the
osgFX::BumpMapping just uses built in OSG nodes that it would be able to
write out the OSG nodes that are created by osgFX::BumpMapping. Is that
the case?

 

Thanks.

 

Alex

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


[osg-users] Linking error : OpenThread

2008-09-04 Thread Rahul Jain

Hi all,
While compiling my application with OSG2.6 I am getting following 
linking error  "*undefined reference to 
`OpenThreads::Atomic::operator--()*". The same application is linked 
properly with OSG2.4.  Since i am not using Atomic operation in my 
application, i  am not able to find the reason for failure.Any guesses ?

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


Re: [osg-users] adaptation of chunkLOD to OSG

2008-09-04 Thread [EMAIL PROTECTED]

Robert Osfield wrote:

Hi Hannes,

On Fri, Aug 29, 2008 at 8:27 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

someone from the project came up with this question:


"the project" being??  Your own project?


http://sourceforge.net/projects/csp
http://csp.sourceforge.net/
The Combat Simulator Project


I think this demo never became part of OSG, which is also what Robert
states in his response to your question. Anyway, I don't get what
exactly he's talking about in terms of the relationship between
ChunkedLOD and osgDB::DatabasePager. The chunking aspect in
ChunkedLOD refers to the fact the rendering algorithm divides the
terrain mesh into individual chunks that can be sent to the gfx
adapter separately, eliminating the need to re-build the whole mesh
every time the camera perspective changes. In my understanding,
osgDB::DatabasePager is used to load terrain tiles in a background
thread, but is not directly to the actual rendering operations.


DatabasePager only does loading of subgraps in a background thread,
incremental compiling of OpenGL objects, merge of new subgraphs and
deleting of expired subgraphs.   This is not equivalent to ChunkedLOD,
rather just one component of such as system, although I'd guess
DatabasePager is far more capable than most paging systems that you'll
find on ChunkedLOD implementations.

The division of the database up is pre-processing step that is done by
VirtualPlanetBuilder, which builds a hierarchical tiled database.  VTP
is extremely scalable and can terrabyte geospatial whole earth
databases.  All the databases generated by VTB are viewable in OSG
applications, with the DatabasePager managing the paging automatically
for you, and either standard osg::Geometry/osg::StateSet/osg::Node
subgraphs or osgTerrain based subgraphs handling the scene
representation and rendering.   VTB is the only source tool of its
kind as far as I'm aware.

Put osgDB::DatabasePager and VTP generated databases together and you
have something that is far more scalable and capable than a ChunkedLOD
implementation.

Robert.


originally someone did a test with photo realistic terrain.
video (40s):
High resolution (26 Mo) http://documents.cigognes.net/csp/csp-terrain-photo.avi
Low resolution (YouTube) http://fr.youtube.com/watch?v=1NlZoylXrlo

we are a little bit confused.
http://csp.sourceforge.net/forum/viewtopic.php?p=4616#4616

is http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/osgdem 
what you mean or are we on the wrong way?

with VirtualPlanetBuilder you mean 
http://www.openscenegraph.org/projects/VirtualPlanetBuilder
with VTP you mean http://www.vterrain.org/
i did not find anything about VTB, is it a mistyped VTP?


thanks for your help in our confusion.

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


Re: [osg-users] AnimationPathCallback timeMultiplier

2008-09-04 Thread Dickinson, Alan J.
Hi Ulrich and Robert,
 
I agree with you Ulrich. I have been looking at the getAnimationTime
method which uses an absolute time calculation instead of a relative
delta time approach. I am working on adding a _prevTime instance
variable to the operator() method to save the _latestTime from the
previous timestamp. Then calculate the animationTime as you suggested. 
 
Not sure how the timeOffset is suppose to work. In the original absolute
formula it is subtracted from the ((Tlast-Tfirst) - timeOffset) *
timeMultiplier but that seems to be a negative offset. Is this the
correct interpretation or am I missing the intent of the timeOffset.
 
Also I am in the process of adding the ability to single step the
animation while it is paused. I think I need to change the pauseTime by
my stepSize to make this happen but I need to fix the getAnimationTime
method first. 
 
How do I force the animation to redraw while it is paused with the new
pauseTime value?
 
FYI: I have been working with both 2.4 and 2.6 released versions
currently...
 
Thanks again for your help,
 
Alan
 
>Hi Alan and Robert,
 
>Robert Osfield wrote:
>> The sounds very much like a bug where the pause code is being broken
>> by changes in the multiplier.  Have a look at the
>> AnimationPathCallback implementation to see if you can spot what
might
> amiss.
 
>I believe this behaviour is due to the way the animation time is
calculated.
 
>It's not incremental (t += dt * timeMultiplier) which would be
continuous when the
>multipler changes, but absolute (t = (Tlast - Tfirst) * timeMultiplier)
which will jump
>when you change the multiplier.
 

 

 

Alan Dickinson

SAIC Intelligent Systems Applications Division

Sr. Software Engineer

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


[osg-users] osgmultiplerendertargets

2008-09-04 Thread paul1492
I'm getting a segmentation fault when running the osgmultiplerendertargets 
example using OSG 2.6 under Linux.The call stack says its in 
RenderStage::runCameraSetUp. My OSG isn't currently compiled debug. Am I doing 
something wrong? Do I need command line arguments?

Paul P


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


Re: [osg-users] Using Kd-tree for spatial data

2008-09-04 Thread maruti borker
Thanks for pointing out , i looked into the discussion and i think the
current setupd with kd-trees wont help me with my idea. Can anyone point me
to some tool/project which creates just the kd-tree ( near to optimal )
given a 3d scene . Any help would be appreciated.

Thanks

Maruti Borker
IIIT Hyderabad
Website:- http://students.iiit.ac.in/~maruti
Blog:- http://marutiborker.wordpress.com


On Thu, Sep 4, 2008 at 3:00 PM, Robert Osfield <[EMAIL PROTECTED]>wrote:

> HI Maruti,
>
> Lots was discussed on osg-users about the KdTree implementation in the
> OSG when I intergrated the functionality, so have a look through the
> osg-users archives in June and July.   The quick answer is that
> KdTree's hang off Drawables, and when do intersection testing first
> coarsed grained culling is done by the scene graphs hierachy of
> bounding spheres/boxes, then finally fine grained testing is done
> against the KdTree hanging of the drawables.
>
> Robert.
>
> On Thu, Sep 4, 2008 at 7:27 AM, maruti borker <[EMAIL PROTECTED]>
> wrote:
> >
> > Hello,
> >I was amazed to see the development  OSG has made, the
> > last version i used it was 2.3.4. Coming to the topic,  i wanted to know
> how
> > a scenegraph was being linked to a kd-tree for finding out intersections.
> I
> > am thinking of an application which needs querying of spatial data, for
> > which i thought of using kd-trees , but i also thought of having a
> > scenegraph for rendering purposes. I looked at a work "Razor:
> > Multi-resolution ray tracing for dynamic environments" by William mark
>  and
> > Warren hunt. They also lazily linked a scene-graoh and a kd-tree. I
> wanted
> > to know how the kd-tree is being linked to a scenegraph in OSG and also
> > whether i could actually access the kd-tree for performing algorithms on
> top
> > of it. And also an advice whether using this linkage in OSG is useful for
> > storing spatial data. Do mail back incase of any doubts or clarifications
> .
> >
> >
> > Maruti Borker
> > IIIT Hyderabad
> > Website:- 
> > http://students.iiit.ac.in/~maruti
> > Blog:- http://marutiborker.wordpress.com
> >
> > ___
> > 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] poker_client_player_chips

2008-09-04 Thread Cedric Pinson

oops sorry bad mailing list

Cedric Pinson wrote:

Hi,

Here a patch to add a packet in client side (pokerexplain.py). This 
packet translate the player bet and player amount into chips stack 
unit. Like bet2pot, or player2bet packet. So now each 
poker_player_chips sent to the client is accompagned with a 
poker_client_player_chips.
The patch add the functionality and an update of test related to 
update of chips of player.



Something not related with my patch:
I noticed that in test the chips stack unit works fine but when 
connected to the table like jspoker.pokersource.info:20380 gameid:121 
the chips value seems to not be known because every packet generated 
on the client side after a normalize + a pokerchips the result is 
something like [1,5000]

Would it be possible the chips value are not sent to the clients ?

Cedric



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


--
+33 (0) 6 63 20 03 56  Cedric Pinson mailto:[EMAIL PROTECTED] 
http://www.plopbyte.net


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


[osg-users] poker_client_player_chips

2008-09-04 Thread Cedric Pinson

Hi,

Here a patch to add a packet in client side (pokerexplain.py). This 
packet translate the player bet and player amount into chips stack unit. 
Like bet2pot, or player2bet packet. So now each poker_player_chips sent 
to the client is accompagned with a poker_client_player_chips.
The patch add the functionality and an update of test related to update 
of chips of player.



Something not related with my patch:
I noticed that in test the chips stack unit works fine but when 
connected to the table like jspoker.pokersource.info:20380 gameid:121 
the chips value seems to not be known because every packet generated on 
the client side after a normalize + a pokerchips the result is something 
like [1,5000]

Would it be possible the chips value are not sent to the clients ?

Cedric

--
+33 (0) 6 63 20 03 56  Cedric Pinson mailto:[EMAIL PROTECTED] 
http://www.plopbyte.net


Index: pokernetwork/pokerexplain.py
===
--- pokernetwork/pokerexplain.py(revision 4409)
+++ pokernetwork/pokerexplain.py(working copy)
@@ -148,6 +148,7 @@
 chips = self.normalizeChips(game, 
chips))
 packets.append(packet)
 packets.append(self.updatePlayerChips(game, player))
+packets.append(self.explainPlayerChips(game, player))
 return packets
 
 def chipsBet2Pot(self, game, player, bet, pot_index):
@@ -165,8 +166,10 @@
  pot = pot_index)
 packets.append(packet)
 packets.append(self.updatePlayerChips(game, player))
+packets.append(self.explainPlayerChips(game, player))
 return packets
 
+
 def chipsPot2Player(self, game, player, bet, pot_index, reason):
 packet = PacketPokerChipsPot2Player(game_id = game.id,
 serial = player.serial,
@@ -314,6 +317,7 @@
 forward_packets.append(PacketPokerBoardCards(game_id = 
game.id, serial = self.getSerial()))
 for serial in game.player_list:
 
forward_packets.append(self.updatePlayerChips(game, game.serial2player[serial]))
+
forward_packets.append(self.explainPlayerChips(game, 
game.serial2player[serial]))
 forward_packets.extend(self.updatePotsChips(game, []))
 
 elif packet.type == PACKET_POKER_CANCELED:
@@ -482,11 +486,8 @@
 #
 player = game.getPlayer(packet.serial)
 player.buy_in_payed = True
-chips = PacketPokerPlayerChips(game_id = game.id,
-   serial = packet.serial,
-   money = player.money,
-   bet = player.bet)
-forward_packets.append(chips)
+forward_packets.append(self.updatePlayerChips(game, 
player))
+forward_packets.append(self.explainPlayerChips(game, 
player))
 
 elif packet.type == PACKET_POKER_PLAYER_CHIPS:
 player = game.getPlayer(packet.serial)
@@ -507,7 +508,9 @@
 player.money = packet.money
 if player.money > 0:
 player.buy_in_payed = True
+forward_packets.append(self.explainPlayerChips(game, player))
 
+
 elif packet.type == PACKET_POKER_FOLD:
 game.fold(packet.serial)
 if game.isSitOut(packet.serial):
@@ -652,7 +655,7 @@
 
 packets.extend(self.updatePotsChips(game, game.getPots()))
 return packets
-
+
 #
 # Should be move all bets back to players (for uncalled bets)
 # This is a border case we don't want to handle right now
@@ -696,6 +699,15 @@
 games.remove(exclude)
 return PacketPokerCurrentGames(game_ids = games,
count = len(games))
+
+def explainPlayerChips(self, game, player):
+packet = PacketPokerClientPlayerChips(game_id = game.id,
+  serial = player.serial,
+  bet = self.normalizeChips(game, 
player.bet),
+  money = 
self.normalizeChips(game, player.money) )
+return packet
+
+
 
 def packetsPot2Player(self, game):
 packets = []
@@ -747,6 +759,7 @@
 
 for player in game.serial2player.itervalues():
 packets.append(self.updatePlayerChips(game, player))
+packets.append(self.explainPlayerChips(game, player))
 packets.extend(self.updatePotsChips(game, []))
 return packets
 
Index: tests/test-pokeravatar.py.in

Re: [osg-users] Development pathway

2008-09-04 Thread Robert Osfield
Hi Marmut,

Comments interspersed below.

On Tue, Sep 2, 2008 at 10:44 PM, Hartmut Seichter
<[EMAIL PROTECTED]> wrote:
> - documentation, there are numerous additions recently and in the past like
> osgWidgets or osgManipulators which are very interesting but not as
> interesting to reverse document the code - at least a "real" API
> documentation would be sufficient

By "real" API documentation do you mean better doxygen docs?

In case osgWidget, Jeremy has already come forward :-)

In case osgManipulator, this is more problematic as the original
author can gone very quiet since submitting the library, perhaps they
are still lurking and willing to come out and help document.
Otherwise we're all in the same boat in needing to learn the API from
the code and document this.

> - examples: I am also partly teaching computer graphics and an augmented
> reality class which heavily rely on OSG. One of the problems I see the
> students facing is that some of the examples are actually applications and
> seem to have started simple and went off to show the most convoluted
> brain-jogging way to achieve something simple - van der Rohe: Less is More

Different examples have had different lives.  Most start of simple,
but over time get extended either because underlying features grow in
capabilities, or that an example grows to test a particular feature
out thoroughly.   There may be cases where things could be simplified
without loosing there functionality, but it's a very much case of each
different example having to be treated on its own merits/failing.

If you know of particular examples that could do with a revamp then
please just enumerate them so that others can consider what might be
the right thing to do with them.

> On the deployment and integration side:
>
> - API additions which change ABI are not documented well: with osgSWIG I am
> basically poking in the dark, waiting for SWIG to cough up the changes
>
> - do I assume right/wrong that API change involves an increment in
> SOVERSION, it would make backwards compatibility easy

API revision lead to the SOVERSION being incremented, and even in most
dev releases you'll find the SOVERSION being bumped.

The svn repository itself is the also a very effective way of tracking
these changes.  In particular the online browsing of the svn repostory
can point to the last time different directories contents were
touched:

   http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/trunk

Another way that might be effective would be to for us to generate a
serialization out of the classes and methods that the wrappers
provide.  Perhaps this might even help with generating the interface
files for Swig.

Can I suggest striking up another thread to discuss language bindings
maintenance.  I would personally like to see more integral support for
other languages in the OSG.  My original hope was that
osgIntrospection would be the platform for a whole range of language
bindings that were easy to create and maintain, but alas this has
never caught on.   I'm not an expert in this direction so need others
to provide leadership and guidance with the implementation details.

> And now the more deep down things, which I think would be interesting to
> look at in a long term plan:
>
> - with the Mac OS X 10.4 - 10.5 disaster it should be clear that one can't
> assume a certain implementation of OpenGL available and relying on it on the
> front-end

Could you be more specific.  What parts constitute a "disaster" on
OSX.  Yesterday I was building and running OSG apps under OSX 10.5
without any serious issues - ATI support for shaders wasn't great, but
otherwise things worked well.

> - this leads unevitably to OpenGL 3.x and OpenGL ES 2.0 (what happened to
> the investigation of this?) on the horizon - which hints for hidden backends
> as with ES there is no certainty of the actual implementation of parts of
> the API - so you might need to roll your own depending on the hardware
> detected

The OSG has been ported to OpenGL ES 1.x now, and a initial submission
of this work is pending.  Once I've reviewed the changes I will know
better how easily we can integrate things in a maintainable way.

OpenGL ES 2.x and OpenGL 3.x are another leap that need lots of review
and thinking time.  Until we actually have working implementations on
our desktops it's hard to make much progress.

I'm also rather busy with other work, looking into this future
developments in something I have to squeeze into my non existent free
time...   Once VPB 1.0 is done and dusted I should have more breathing
room for this type of exploratory work.

> - bundling math includes in one header to be able to exchange some
> implementation (ie. floating point emulation)

I'm afraid this isn't clear what you mean here.  You'll need to
provide examples.

With float point emulation, it might be a leap too far in terms of
ease of support/maintenance.  Targeting floating point profiles of
OpenGL may well avoid a lo

Re: [osg-users] Correction of wikipage Support/Maths/MatrixTransformations

2008-09-04 Thread Robert Osfield
HI Matthias,

On Thu, Sep 4, 2008 at 12:36 PM, Matthias Bindernagel
<[EMAIL PROTECTED]> wrote:
> On the page is stated that one should load a column-major-matrix with
> glLoadMatrixf(). And then there's this example given:
>
>  | cosA  -sinA   00 |
>  | sinA   cosA   00 |
>  | 0010 |
>  | 0001 |
>
> GLfloat ZrotateMatrix[][4] = {
>   { cosA, -sinA, 0, 0 },
>   { sinA,  cosA, 0, 0 },
>   {0,  0,1, 0 },
>   {0,  0,0, 1 }
> };
>
> Which is, in fact, a row-major-matrix (to make it column-major one must swap
> sinA and -sinA). Afterwards is it argumented that the actual outcome does
> not match the desired one - which cannot happen, if you pretend to pass a
> column-major-matrix, but actually pass a row-major-matrix.
>
> My problem with this erroneous example is that its assumed correctness is
> the foundation for the whole following argumentation.

OK, re-reading the C code, yes it does look wrong - this is where the
documented OpenGL column major convention is confusing... because in
memory it's not column major at all, its row major in memory.  The
code you highlight is correct for the OSG - where the C array ordering
is exactly the same as the way you'd write the matrix.  The same is
true for vectors - in C you'd write them float v[3]={x,y,z};  But of
course the OpenGL documentation would have this vector transposed into
a column vector.

It might be best to have this page re-written.  I'm not the original
author, and if fact this is the first time I've read this particular
page.  Perhaps others with better teaching skills can dive in a fix
this page.

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


Re: [osg-users] Caustics for UnderWater Effect

2008-09-04 Thread Robert Osfield
Hi Umit,

I'd use a Texture3D to animate through the images (see osgtexture3D
for an example), or if you don't need blending ImageSequence would
work on a Texture2D (see osgimagesequence for an example).
Texture2DArray is also possible, but it's only supported on latest
hardwares/drivers.

Robert.

On Thu, Sep 4, 2008 at 2:50 PM, Ümit Uzun <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I have 30 textures for caustics. I want to make a underwater effect so have
> to alpha blend texture to terrain surface which was created with
> VirtualPlanetBuilder.
>
> My question is, how should I animate these textures on the terrain?
> Should I read all texture images to the Texture2DArray and then change the
> texture images by the time with using NodeCallback?
> Is there any sample like that or which osg example would help me much?
>
> Best Regards.
>
> Umit UZUN
>
> ___
> 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] how to use CoordinateSystemNode?

2008-09-04 Thread Glenn Waldron
Hi Forest,

The CoordinateSystemNode only communicates the CS of the underlying scene
graph. Nothing in OSG actually reprojects the coordinates. You need to use
something like GDAL/OGR to do that. (see:
http://www.gdal.org/ogr/osr_tutorial.html)

You will need to either a) rebuild your city file in WGS84 so that it lines
up with the terrain when loaded, or b) reproject the verticies in the city
geometry into WGS84 after you load it.

Hope this helps. -Glenn

-- 
Glenn Waldron : Pelican Mapping : http://pelicanmapping.com :
+1.703.652.4791

2008/9/4 forest37 <[EMAIL PROTECTED]>

>  hi all,
>   Now I have two files, "earth.osga " and "city.ive" .
>   The first file use GEOGCS WGS 84 CoordinateSystem and the second file
> use PROJCS UTM Zone  CoordinateSystem ,I add them both into the scene.But i
> only can see the scene of the first file,that is the earth.No matter how i
> zoomed in and out ,I still can't find the scene of the second file which is
> a city .
>  what I want to do is to show the earth and city like google earth,what
> should i do?
>
>  thanks for any hint.
>
> best regards
>
> forest
>
>
>
>
>
> --
> 200万入主万科中粮紫苑155平米8重空间大宅 周周送好礼
> ___
> 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: SKYBOX ?

2008-09-04 Thread Jeremy Moles
On Thu, 2008-09-04 at 10:22 +0100, Robert Osfield wrote:
> On Wed, Sep 3, 2008 at 7:27 PM, Jeremy Moles <[EMAIL PROTECTED]> wrote:
> > In your defense, however, I'm not able to actually get any test code for
> > Extensions working at all. Some of the examples create Extensions
> > objects (osgvertexprogram, osgmultitexture), but they never return a
> > valid pointer--at least for me.
> 
> The Extensions objects will be null until they are first access from a
> thread that has a valid graphics context, its only once you have a
> graphics context that you can do any OpenGL command including checking
> for extensions.
> 
> So query the extensions object after realize and you should have success.

Hmm, I'm still not able to get it working. I'm using the code from
osgmultitexture and the textExt pointer is always null for me. Do you
think it's a local bug, or is that a valid pointer on your system when
you run osgmultitexture?

I'd like to make a quick example, osgglinfo, if I can get this working
easily. :)

> 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] Caustics for UnderWater Effect

2008-09-04 Thread Ümit Uzun
Hi All,

I have 30 textures for
*caustics
*. I want to make a underwater effect so have to alpha blend texture to
terrain surface which was created with VirtualPlanetBuilder.

My question is, how should I animate these textures on the terrain?
Should I read all texture images to the Texture2DArray and then change the
texture images by the time with using NodeCallback?
Is there any sample like that or which osg example would help me much?

Best Regards.

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


Re: [osg-users] how to use CoordinateSystemNode?

2008-09-04 Thread Robert Osfield
HI Forest,

You make no mention of how you position the city model into the whole
earth model.  The way I'd tackle this would be to compute the
transform from your projection coordinates to ECEF using a
MatrixTransform, this would retain the cities local origin for good
precision.  If the city area is wide enough the curvature of the earth
might be an issue so you may need to do local transforms of individual
objects or vertices to properly fit the curvature of the earth.

Robert.

2008/9/4 forest37 <[EMAIL PROTECTED]>:
>  hi all,
>   Now I have two files, "earth.osga " and "city.ive" .
>   The first file use GEOGCS WGS 84 CoordinateSystem and the second file
> use PROJCS UTM Zone  CoordinateSystem ,I add them both into the scene.But i
> only can see the scene of the first file,that is the earth.No matter how i
> zoomed in and out ,I still can't find the scene of the second file which is
> a city .
>  what I want to do is to show the earth and city like google earth,what
> should i do?
>
>  thanks for any hint.
>
> best regards
>
> forest
>
>
>
>
> 
> 200万入主万科中粮紫苑155平米8重空间大宅 周周送好礼
> ___
> 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] how to use CoordinateSystemNode?

2008-09-04 Thread forest37
 hi all,
  Now I have two files, "earth.osga " and "city.ive" .
  The first file use GEOGCS WGS 84 CoordinateSystem and the second file use 
PROJCS UTM Zone  CoordinateSystem ,I add them both into the scene.But i only 
can see the scene of the first file,that is the earth.No matter how i zoomed in 
and out ,I still can't find the scene of the second file which is a city .
 what I want to do is to show the earth and city like google earth,what 
should i do?
 
 thanks for any hint.
 
best regards
 
forest
 
 
 ___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] BorderWidth

2008-09-04 Thread Korolyov Ilia
Thanks, Robert

Ilia

В Чтв, 04/09/2008 в 10:33 +0100, Robert Osfield пишет:
> Hi Korolyov, or Ilia? (it's best to sign your emails so we know what
> your first name is)
> 
> On Thu, Sep 4, 2008 at 9:26 AM, Korolyov Ilia <[EMAIL PROTECTED]> wrote:
> > What's the purpose of BorderWidth property in osg::HeightField? I
> > looking throught code but can't find any deal this it. What is it for?
> 
> The doxygen docs explain:
> 
> /** Set the width in number of cells in from the edge that the
> height field should be rendered from.
>   * This exists to allow gradient and curvature continutity to
> be maintained between adjacent HeightField, where
>   * the border cells will overlap adjacent HeightField.*/
> 
> It's more of an experimental feature though, its not one used widely.
> 
> 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] 2.6 Mac OS X issues and some solutions

2008-09-04 Thread James Turner


On 4 Sep 2008, at 14:34, Eric Sokolowsky wrote:

Yes, for now, the cmake project does not create OSG frameworks.  
We're working on this. Creating dylibs works fine. These dylibs can  
be installed on a developer's system or embedded into an  
application. Since most of the example programs require command-line  
arguments to run properly, it's not too much of a burden to set  
environment variables. Once we get frameworks built with cmake the  
environment variables should not be necessary.


I'd be happy to test any work-in-progress on building frameworks for  
CMake - and since OSG is currently 'unstable' it'd seem like a good  
time to get in into SVN so people can try it and work through and  
problems that arise.


James

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


Re: [osg-users] 2.6 Mac OS X issues and some solutions

2008-09-04 Thread Filip Wänström
Great, then I know that I have a working path and in the future it gets even
better. :)
Since I haven't used OSG for a few years (1.2 was the last thing I tried in
2006 I think) I have some catching up to do. And at that time I had to use
Windows. This time around I hope I can use a Mac instead. If this works out
I hope I will be able to contribute in some way.

/Filip - back to coding...


On Thu, Sep 4, 2008 at 2:34 PM, Eric Sokolowsky <[EMAIL PROTECTED]> wrote:

> Filip Wänström wrote:
>
>> Hi again, wanted to add that the template xcode "OSG Application" needs to
>> be updated. (and changed if you want it to work right now)
>>
>> Since I tried the CMake route that creates regular .so files and headers
>> in /usr/local instead of creating mac os frameworks the template need to be
>> changed by removing all the framework linkings. In addition, some of the
>> headers in the precompiled header file is out of date it seems.
>> Introspection and osgSim/OpenFlightOptimizer
>>
>> I willl change the template so it works with libs and am of course willing
>> to share if anyone want it.
>>
>> I'm not saying that the template should be changed to using regular libs
>> instead of frameworks in the long run but for the time being that is the
>> easiest way for me to start developing on the mac (and get a homey linux
>> feeling as well..)
>>
>> I'm not sure what the status is for generating frameworks from the xcode
>> project that CMake creates. Hopeully this is remedied in a not to far
>> future. For now, I'm glad that I can use xcode to create osg projects that
>> works fine.
>>
>>
>
> Yes, for now, the cmake project does not create OSG frameworks. We're
> working on this. Creating dylibs works fine. These dylibs can be installed
> on a developer's system or embedded into an application. Since most of the
> example programs require command-line arguments to run properly, it's not
> too much of a burden to set environment variables. Once we get frameworks
> built with cmake the environment variables should not be necessary.
>
> -Eric
>
> ___
> 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] Collision of Spheres

2008-09-04 Thread Jean-Sébastien Guay

Hello Vijay,


Also after calling getBound, Drawable objects returning a BoundingBox
(instead of BoundingSphere) object is just a design decision, right?
Is there anything that prevents us in having a BoundingSphere for
Drawable objects?


The bounding volumes OSG maintains in every Node and Drawable are there 
to facilitate view frustum culling. A bounding box will generally fit 
closer to an object than a bounding sphere (one exception being if the 
object itself is a sphere :-) ) but also costs more to test for 
inclusion within the view frustum.


So the idea is that any Group's bounding sphere includes the bounding 
volumes of all its children, and any Geode's bounding sphere includes 
the bounding boxes of all its Drawables. While traversing the graph in 
the cull traversal, the Nodes (Groups and Geodes in this example) will 
be tested for inclusion in the view frustum. Since it's a sphere/frustum 
test, it's pretty quick. When the test passes, the children are examined.


Once we get to a Geode and the test still passes, we want to have a 
better test to make sure we aren't drawing Drawables for nothing. Since 
the drawing cost is relatively high in general, it makes sense to use a 
slightly more costly test and potentially avoid the high cost of drawing 
the Drawable. So this is where the Drawable's bounding box is tested 
against the frustum. If this final test passes, the Drawable will be put 
in the render graph to be rendered in the draw traversal.


I hope this explains the general rationale for the presence of bounding 
spheres on Nodes and bounding boxes on Drawables. Note that I took some 
shortcuts in explaining it, but it should make it clearer.


Please see Paul's followup to my message which gives you a way of 
creating a bounding sphere from your Sphere which will be identical to 
the original object.


Hope this helps,

J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   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] 2.6 Mac OS X issues and some solutions

2008-09-04 Thread Eric Sokolowsky

Filip Wänström wrote:
Hi again, wanted to add that the template xcode "OSG Application" 
needs to be updated. (and changed if you want it to work right now)


Since I tried the CMake route that creates regular .so files and 
headers in /usr/local instead of creating mac os frameworks the 
template need to be changed by removing all the framework linkings. In 
addition, some of the headers in the precompiled header file is out of 
date it seems. Introspection and osgSim/OpenFlightOptimizer


I willl change the template so it works with libs and am of course 
willing to share if anyone want it.


I'm not saying that the template should be changed to using regular 
libs instead of frameworks in the long run but for the time being that 
is the easiest way for me to start developing on the mac (and get a 
homey linux feeling as well..)


I'm not sure what the status is for generating frameworks from the 
xcode project that CMake creates. Hopeully this is remedied in a not 
to far future. For now, I'm glad that I can use xcode to create osg 
projects that works fine.





Yes, for now, the cmake project does not create OSG frameworks. We're 
working on this. Creating dylibs works fine. These dylibs can be 
installed on a developer's system or embedded into an application. Since 
most of the example programs require command-line arguments to run 
properly, it's not too much of a burden to set environment variables. 
Once we get frameworks built with cmake the environment variables should 
not be necessary.


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


Re: [osg-users] 2.6 Mac OS X issues and some solutions

2008-09-04 Thread Filip Wänström
Stephan,

I'm absolutely not in to here to point fingers etc. I just wanted to share
my experience when trying to build on the Mac for the first time in a long
long time (last time I tried all mac was X11 and the osg version was 0.9 or
so). I'm not interested so much in explanations (even though they can be
enlightening) as I am in solutions. I personally  need to know if I can use
the Mac as a development platform for real time 3D applications today. Can I
use OSG to help me from reinventing the wheel? Do I have to abandon the Mac
in favor for Windows? These are the questions I need to get answered. By
myself and with the help from others. Like this eminent list.

Obviously, things like what you describe can happen and can be easy to fix.
But when you are evaluating a platform or and API, all friction works
against it. Issues like that should be sorted out in the pre-rc state in a
best case scenario. As its stands, one (me!) gets discouraged and tends to
think that these issues reflect the general state of things...

In any case, I think it would be good to make one single, clear, general and
working path for the Mac OS X build. If one download code, one should be
able to follow a tutorial along and get the stuff working. I hope no-one is
offended by this as I fully understand that no one gets payed for making
sure everything works fine etc etc.

I have written down my experience, hopefully this can be used to change some
of the documentation on the web. I can not change it myself (or can I?)
Otherwise I could have made the changes on the Wiki/Trac. And, since I'm
kind of new to this game (this time around) I thought it would be better to
air my thoughts on this list.

I have changed the xcode template on my system so that it uses libs instead.
I could upload that somewhere if I knew how alongside information on how to
do use it. (and for review, obviously)

Anyway, I hope this might lead to further, and fruitful, discussion on the
state of the Mac.

Best regards
/Filip



On Thu, Sep 4, 2008 at 1:20 PM, Stephan Maximilian Huber <
[EMAIL PROTECTED]> wrote:

> Filip Wänström schrieb:
>
>> 1. There is not much documentation (The biggest problem is that a lot of
>> documentation is contradictory or just to old). So it's trial and error
>> (and
>> patience).
>>
>>
> I am sorry, that the xcode-project didn't work for you -- I am maintaining
> it in my spare time. Unfortunatley I cannot donate as much time as I want to
> to keep the xcode project running. Maintaining the hand-crafted
> Xcode-project files is error-prone and tedious to do.
>
> But your problem is easy fixable. Just select the group osgWidget in
> OpenSceneGraph/src and reselect the source-folder. Unfortunately XCode
> stored an absolute path to the osgWidget folder. This worked for me, but not
> for you :)
>
> Regarding moving the XCode-folder to the deprecated section: As long as
> most OS X users do their stuff with libraries I am not against the move.
> Even better would be a cMake solution building frameworks natively. But I am
> not an cMake-guru and can't say anything about that route and if it works.
>
> cheers,
> Stephan
>
>
>
>
> ___
> 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] 2.6 Mac OS X issues and some solutions

2008-09-04 Thread E. Wing
On 9/4/08, Robert Osfield <[EMAIL PROTECTED]> wrote:
> Hi Filip,
>
> On Thu, Sep 4, 2008 at 11:14 AM, Filip Wänström
> <[EMAIL PROTECTED]> wrote:
>> Since I tried the CMake route that creates regular .so files and headers
>> in
>> /usr/local instead of creating mac os frameworks the template need to be
>> changed by removing all the framework linkings. In addition, some of the
>> headers in the precompiled header file is out of date it seems.
>> Introspection and osgSim/OpenFlightOptimizer
>
> Hopefully we'll be able to get the XCode generation from CMake working
> well enough before OSG-2.8 to enable us to remove all the old hand
> maintained XCode and the oddities like the above that go along with
> it.
>
> I have been threatening to retire the old XCode directory to the
> deprecated section of the OSG svn repository, perhaps now is the time
> to do it... it'd help concentrate our efforts of getting Cmake to work
> flawlessly and help avoid errors like the above creeping in unnoticed.
>  Thoughts OSX users?
>
> Robert.

Sorry, I've been really busy with other things so I haven't been able
to work directly on this. I have been trying to coordinate with Eric
S. who has been making improvements to the CMake build system. I have
independently been testing the final CMake support for framework
building. I think we've weeded out all but one remaining bug.

I have a demonstration/experimental build script that pushes a lot of
the Mac CMake build features for Lua:
http://www.assembla.com/wiki/show/lua
It also offers a lot of specific GUI options for easy reconfiguration.

I envision all the stuff I do there to be transplanted into OSG's build system.

(Also, to see some other things I do, you can glance at some connected
Lua projects from a superproject/forest I made for LuaDoc here:
http://www.assembla.com/wiki/show/luadocsuperforest)

I also have a long-lived branch of OSG with some initial framework
building support and other Mac things found here:
http://www.assembla.com/wiki/show/OpenSceneGraphHg

It's quite a bit stale though as I haven't touched it since WWDC. Eric
S. and I met at WWDC to discuss/work on the OSG build system and I
pointed him to that as a reference. His current changes already
submitted I believe already incorporate some of the stuff, though not
the framework stuff yet. The Lua example may be easier to read since
its much smaller. It is also more up-to-date and more complete (99%).

Anyway, if everybody is free to look at my stuff and I'll be happy to
help with questions you might have, though I'm still time crunched to
find a large block of time to sit down and finish writing the thing.
(That's what happened with my branch...I took too long, and it kept
getting stale so the cost of resyncing with head starting eating up
too much time.)

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


Re: [osg-users] 2.6 Mac OS X issues and some solutions

2008-09-04 Thread Eric Sokolowsky

Filip Wänström wrote:

Hi there!

I tried out to run the 2.6 source release on my MacBook Pro (Leopard 
10.5.4) And run into some issues but it seems that I resolved them in 
the process and I want to share my experience in order to help others 
in a similar situation.


First:

1. The provided Xcode project is out of date/doesn't work. I didn't 
bother further with that after the initial failure to get it to work.
2. There seems to be no updated info on what to do with the Mac 
version except that its seems hard, its not supported and Apple has 
broken binary compatibility going from Tiger to Leopard. Scary stuff. 
I would have stopped here if it wasn't for that I badly want Mac to be 
a viable development environment for me. Maybe  some old info could be 
removed and replaced with a simple "1.2.3" list of what to do now.


Anyway, I decided to go the CMake route even though it's not exactly 
well documented anywhere (neither osg site or CMake homepage talks 
much about the current status of Mac)
This is the recommended route on OSX. There are some notes in the 
README.txt in the root of the OSG distribution on OSX that outline many 
of the steps you list below.


In short it worked, but not completely flawlessly. I found the 
following issues:


1. There is not much documentation (The biggest problem is that a lot 
of documentation is contradictory or just to old). So it's trial and 
error (and patience).
There is documentation, but it is true that much of it is old. I haven't 
done much cleaning up yet.
2. The install script doesn't work since you have to run as root/su to 
install in /usr/local

This is probably true. The install script probably needs work.
3. After install. You need to set OSG_LIBRARY_PATH to the plugin 
install dir
Yes, I realize that this is not standard for OSX. I'm still trying to 
improve the process for OSX users. This is documented in the README.txt.
3b. Since this is very far from common practice when it comes to mac I 
think It can be good to provide an example:



Recommended:
1. Download source (from svn or zipped, I use OpenSceneGraph-2.6.0 as 
the example here)

2. Extract
3. Open terminal and go to your newly created directory (something 
like ~/tmp/OpenSceneGraph-2.6.0)

4. Create a place for building the project (like: ~/tmp/osgbuild)
5. Enter that dir
5. run cmake with the flag -GXcode (cmake -GXcode ../OpenSceneGraph-2.6.0)
6. start ccmake to configure further (you probably want to build the 
examples) (ccmake  ../OpenSceneGraph-2.6.0)
I recommend downloading the OSX GUI cmake tool from the cmake website to 
do the configuration.
7. In the text-gui of ccmake. make changes like turn on the examples 
build. then configure and generate project (c, g)

8. Start the xcodeproject and build (
9. run the installscript from the command line with su privileges ( or 
login as root user for this task)
10. in order to test examples and make sure that plugins work: set the 
environment variables:

Create a file called .profile in you root.
export OSG_LIBRARY_PATH=/usr/local/lib/osgPlugins-2.6.0/
export OSG_FILE_PATH=/path/to_where/you_put/OpenSceneGraph-Data-2.6.0/


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


Re: [osg-users] Texture not clear in far view

2008-09-04 Thread Robert Osfield
Hi Fangqin,

This is case where "A picture is worth a thousand words", so could you
post a picture of the scene with the buildings far away to illustrate
the issue.  It could be lack mip-mapping or could be a driver bug, it
could just the LOD settings on your database are inappropriate... in
short it could be many things, but without a screenshot we can't
really say what it might be.

Robert.

On Thu, Sep 4, 2008 at 12:17 PM, TANG Fangqin <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I have a scene with some buildings in it and use osg::TrackballManipulator
> class for the camera. I used osgDB::readNodeFile to load the scene as a
> node. But I find that the textures somehow are dark and faint when you are
> far from the building.
> This makes the building outline quite obscure. and when you get closer, the
> texture will become clearer.
>
> Does this have something to do with the camera focus or automatic LOD?
>
> Is there any solutions for this? I wish the texture is not quite obscure in
> far view.
> Thanks for your advices in advance.
>
> Best regards,
>
> Fangqin
> ___
> 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] Correction of wikipage Support/Maths/MatrixTransformations

2008-09-04 Thread Matthias Bindernagel
Hi Robert,

> I've just quickly gone through the page you mention and it looks fine.

It does? To me it does not, tho maybe I get the intention of the mentioned
paragraph wrong.

On the page is stated that one should load a column-major-matrix with
glLoadMatrixf(). And then there's this example given:

  | cosA  -sinA   0    0 |
  | sinA   cosA   0    0 |
  | 0        0    1    0 |
  | 0        0    0    1 |

GLfloat ZrotateMatrix[][4] = {
      { cosA, -sinA, 0, 0 },
      { sinA,  cosA, 0, 0 },
      {    0,  0,    1, 0 },
      {    0,  0,    0, 1 }
};

Which is, in fact, a row-major-matrix (to make it column-major one must swap
sinA and -sinA). Afterwards is it argumented that the actual outcome does
not match the desired one - which cannot happen, if you pretend to pass a
column-major-matrix, but actually pass a row-major-matrix.

My problem with this erroneous example is that its assumed correctness is
the foundation for the whole following argumentation.


> As for what convention people use - well it all depends on what your
> background is, as to whether you view a vector as a column or a row,
> as also the pre/post multiplication.   With the osg vectors are a row,
> and the matrices are row major - consistent with how data is actually
> stored in OpenGL and OSG.

Little remark regarding this paragraph: Don Burns states on the
  wikipage "The books seem to use column major, prefix notation,
  including the OpenGL book". glLoadMatrixf() also uses column-major.
  Now I'm getting really confused, you state OpenGL uses row major!?

You're definitely right on this one, it is just a matter of convention. My
post should not address the choice of convention, but rather the
argumentation of this choice and its consequences.

The page mixes the following forms of matrix products:
V' = V * M (1)
W' = N * W (2)
where V' and W' are transformed vectors, V and W are original vectors and M
and N are transformation matrices. But these forms are not equal as you
state in the last paragraph of the wikipage: V and V' must be row vectors,
W and W' must be column vectors, that is, V is the transpose of W and V' the
transpose of W' (technically this does not make much of a difference).
Furthermore - and most important - M is the transpose of N (since matrix
products are not commutative, you must transpose both operands first to
swap operands). Taking these assumptions into account (1) and (2) do lead
to the same result.

But, since most books and internet lectures on this topic use the form (2),
one cannot use the usual transformation matrices presented in those
lectures when using form (1), but rather the transpose of such matrices. If
OSG uses original or transposed transformation matrices is not stated - in
my eyes these information are essential for a correct and broad
understanding.

I hope you get my point right, as I am trying to understand the internal
maths of OSG. To me the mentioned example looks just wrong and in my
understanding of the wikipage, the rest of the argumentation on this page
relies on this example. Also, you use prefix notation, which requires the
use of transposed trafo matrices (compared to usual math book notation with
column vectors - the "usual" refers to my personal experience ;)) ...
Failure to apply the transposed matrices could be "corrected" by using the
wrong form of matrices passed to glLoadMatrixf() - so both errors would
cancel themselves out.
I don't know if this is the case, actually I doubt it is. But the wikipage
is not able to convince me in a coherent way. There are information on the
page I can rely on (like your last paragraph on the page), but then there
are these 2 (to me obviously) wrong uses of glLoadMatrixf() and some vague
statements regarding matrix multiplication order, where V' = V * M and V' =
N * V are used interchangeably, tho M and N are definitely not the same. So
I would like to have is some clarity regarding the actually applied
convention and its consequences for the used transformation matrices.

Thanks for reading,
Matthias Bindernagel


>
> On Wed, Sep 3, 2008 at 7:19 PM, Matthias Bindernagel
>
> <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > on the page
> > http://www.openscenegraph.org/projects/osg/wiki/Support/Maths/MatrixTrans
> >formations is stated that one should
> >
> >>pass this matrix
> >>
> >>GLfloat ZrotateMatrix[][4] = {
> >>  { cosA, -sinA, 0, 0 },
> >>  { sinA,  cosA, 0, 0 },
> >>  {0,  0,1, 0 },
> >>  {0,  0,0, 1 }
> >>};
> >>
> >>to glLoadMatrixf(): and see what happens (g'ahead try it, don't take my
> >> word
> >
> > for it).
> >
> >>Your rotations will be the opposite of what you expect.
> >
> > Well, the correctness of the result depends on what you expect: OpenGL's
> > glLoadMatrixf() and its variants expect a column-major-matrix as
> > parameter (see
> > http://www.opengl.org/sdk/docs/man/xhtml/glLoadMatrix.xml); passing a
> > row-major-matrix (like done in this example) to glLoadMatrixf() results
> >

Re: [osg-users] Collision of Spheres

2008-09-04 Thread Vijay Patil
Thank you Paul for your inputs.

On Wed, Sep 3, 2008 at 11:24 PM, Paul Martz <[EMAIL PROTECTED]> wrote:
>> I haven't looked at the code specifically, but I think this
>> is the assumption which turns out to be false. The Drawables
>> have bounding boxes, and then the Geodes containing them have
>> bounding spheres which are built to encompass the Drawables'
>> bounding boxes. Hence, the Geode's bounding sphere will be
>> larger than the original sphere because it has to encompass
>> the sphere's bounding box, which has to encompass the sphere itself.
>
> J-S is right here. But, there is a ShapeVisitor class and a
> ConstShapeVisitor class that you can use to create a more accurate bounding
> sphere, as in the code below... (Coding this off the top of my head, so
> forgive typos, thanks.)
>   -Paul
>
> class SphereBoundVisitor : public osg::ConstShapeVisitor
> {
> public:
>SphereBoundVisitor() {}
>virtual ~SphereBoundVisitor() {}
>
>virtual void apply( const osg::Shape& s )
>{
>osg::notify( osg::WARN ) << "Unknown shape." << std::endl;
>}
>virtual void apply( const osg::Sphere& s )
>{
>osg::notify( osg::INFO ) << "Found Sphere." << std::endl;
>
>osg::Vec3 c = s.getCenter();
>float radius = s.getRadius();
>_bs = osg::BoundingSphere( c, r );
>}
>
>osg::BoundingSphere _bs;
> };
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>

This gives me a simpler idea. Since I am storing x, y, z co-ordinates
of the sphere is external ( to SG) objects (Car objects). I could just
use/access that information to create BoundingSphere objects of
desired center and radius, as following code demonstrates:

   /* Check for intersection of one object with every other. */
for(int i = 0; i < (int)carlist.size(); i++) {
for(int j = i+1; j < (int)carlist.size(); j++) {

/* Use pointer to MatrixTransform to *create*
bound objects. */
osg::Vec3d c1(carlist[i]->x, 0.0, carlist[i]->z);
osg::BoundingSphere bs1(c1, RAD);

osg::Vec3d c2(carlist[j]->x, 0.0, carlist[j]->z);
osg::BoundingSphere bs2(c2, RAD);

if(bs1.intersects(bs2)) {
/* Collision detection. Simply reverse direction. */
carlist[i]->dx =  -carlist[i]->dx;
carlist[i]->dz =  -carlist[i]->dz;
carlist[j]->dx =  -carlist[j]->dx;
carlist[j]->dz =  -carlist[j]->dz;
break;
}
}
}


I tried this and it's working fine. Attached is complete code listing.
Next step for me would to study physics behind "elastic collision" and
implement correct deflection.


-- 
Vijay Patil
/* Description: Learning collision detection.
 *
 * Compile and Execute: 
 * $ g++  -L/usr/local/lib -losg -losgDB -losgViewer shape.cpp -o collision
 * $ ./collision
 *
 * */

#include
#include
#include

#include 
#include 
#include 
#include 
#include 
#include 
#include 

#define W 800.0
#define H 800.0
#define MAX_SPEED 5
#define CARCOUNT 10
#define RAD 20.0

using namespace std;

/* Car is drawn as sphere for time being. */
class Car {
	public:
	double dx, dz;
	double x, z;
	osg::MatrixTransform * mt;

	Car() {
		x = -W/2 + rand() % (int)W;
		z = -H/2 + rand() % (int)H;
		dx = (rand() % (MAX_SPEED * 2)) - MAX_SPEED;
		dz = (rand() % (MAX_SPEED * 2)) - MAX_SPEED;
		mt = NULL;
	}

	void move() {
		x = x + dx;
		z = z + dz;
		osg::Matrix m;
		m.makeTranslate(x, 0, z);
		this->mt->setMatrix(m);

		if (x < -W/2.0 || x > W/2.0)
			dx = -dx;
		if (z < -H/2.0 || z > H/2.0)
			dz = -dz;
	}
};

/* Declarations. */
osg::ref_ptr draw_sphere(Car * pcar);

/*-
Entry point. Create and populate scene graph.
-*/
int main()
{
	osgViewer::Viewer viewer;
	osg::ref_ptr root_group = new osg::Group;
	vector carlist;

	viewer.setUpViewInWindow(0, 0, W, H);

	for(int i = 0; i < CARCOUNT; i++) {
		Car * pcar = new Car();
		carlist.push_back(pcar);
		root_group->addChild(draw_sphere(pcar).get());
	}

	viewer.setSceneData(root_group.get());

	osg::Vec3d eye(0.0, -W/2, 0.0);
	osg::Vec3d target(0.0, 0.0, 0.0);
	osg::Vec3d up(0.0, 0.0, 1.0);

	viewer.getCamera()->setViewport(0, 0, W, H);
	
	//viewer.getCamera()->setProjectionMatrixAsPerspective(80., 1., 1., 140. );
	viewer.getCamera()->setProjectionMatrixAsOrtho(-W/2, W/2, -H/2, H/2, -W/2, W/2);
	viewer.getCamera()->setViewMatrixAsLookAt(eye, target, up);
	osg::Timer_t start_tick = osg::Timer::instance()->tick();
	
	while(viewer.done() == 0)
	{
		//viewer.getCamera()->setClearColor(osg::Vec4(1.0, 1.0, 1.0, 1.0));

		osg::T

Re: [osg-users] 2.6 Mac OS X issues and some solutions

2008-09-04 Thread Stephan Maximilian Huber

Filip Wänström schrieb:

1. There is not much documentation (The biggest problem is that a lot of
documentation is contradictory or just to old). So it's trial and error (and
patience).
  
I am sorry, that the xcode-project didn't work for you -- I am 
maintaining it in my spare time. Unfortunatley I cannot donate as much 
time as I want to to keep the xcode project running. Maintaining the 
hand-crafted Xcode-project files is error-prone and tedious to do.


But your problem is easy fixable. Just select the group osgWidget in 
OpenSceneGraph/src and reselect the source-folder. Unfortunately XCode 
stored an absolute path to the osgWidget folder. This worked for me, but 
not for you :)


Regarding moving the XCode-folder to the deprecated section: As long as 
most OS X users do their stuff with libraries I am not against the move. 
Even better would be a cMake solution building frameworks natively. But 
I am not an cMake-guru and can't say anything about that route and if it 
works.


cheers,
Stephan



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


[osg-users] Texture not clear in far view

2008-09-04 Thread TANG Fangqin
Hi All,

I have a scene with some buildings in it and use osg::TrackballManipulator
class for the camera. I used osgDB::readNodeFile to load the scene as a
node. But I find that the textures somehow are dark and faint when you are
far from the building.
This makes the building outline quite obscure. and when you get closer, the
texture will become clearer.

Does this have something to do with the camera focus or automatic LOD?

Is there any solutions for this? I wish the texture is not quite obscure in
far view.
Thanks for your advices in advance.

Best regards,

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


Re: [osg-users] Collision of Spheres

2008-09-04 Thread Vijay Patil
Hi J-S

Thanks for you reply.

On Wed, Sep 3, 2008 at 6:26 PM, Jean-Sébastien Guay
<[EMAIL PROTECTED]> wrote:
> Hello Vijay,
>
>> I expect the bounding sphere to coincide with actual spherical object,
>
> I haven't looked at the code specifically, but I think this is the
> assumption which turns out to be false. The Drawables have bounding boxes,
> and then the Geodes containing them have bounding spheres which are built to
> encompass the Drawables' bounding boxes. Hence, the Geode's bounding sphere
> will be larger than the original sphere because it has to encompass the
> sphere's bounding box, which has to encompass the sphere itself.
>

You are right, my assumption was wrong. I briefly looked at the
relevant OSG source code. Since 'class MatrixTransform' is derived
from 'class Group', I studied Group::computeBound(). Indeed, we are
iterating over all children and calling 'getBound' on them. If a
Drawable object is a child then of course call to getBound will return
a BoundingBox object, which is expanded further (i.e enclosed in a

Following is relevant code:

Group.cpp, BoundingSphere Group::computeBound()

for(itr=_children.begin();itr!=_children.end(); ++itr)
{
const osg::Transform* transform = (*itr)->asTransform();
if (!transform ||
transform->getReferenceFrame()==osg::Transform::RELATIVE_RF)
{
bsphere.expandRadiusBy((*itr)->getBound());
}
}

So when I call getBound on MatrixTransform object, spherical shape
will be enclosed in a bounding box, which in turn will be enclosed in
final bounding sphere. This is what caused the problem.

Also after calling getBound, Drawable objects returning a BoundingBox
(instead of BoundingSphere) object is just a design decision, right?
Is there anything that prevents us in having a BoundingSphere for
Drawable objects?

> I hope this makes sense. If not, draw it on a piece of paper: draw a circle
> (which is your graphical object), then draw the smallest box that
> encompasses this circle, and then draw the smallest circle that encompasses
> that box. The second circle will inevitably be larger than the first one.
>
> It's also pretty easy to make a visitor that will add a graphical
> representation of all bounding volumes of a scene.
>

Yes I think so. IIRC there was a thread with lots of attachment about
this. Will look into it.

Thanks again.

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


Re: [osg-users] 2.6 Mac OS X issues and some solutions

2008-09-04 Thread Robert Osfield
Hi Filip,

On Thu, Sep 4, 2008 at 11:14 AM, Filip Wänström
<[EMAIL PROTECTED]> wrote:
> Since I tried the CMake route that creates regular .so files and headers in
> /usr/local instead of creating mac os frameworks the template need to be
> changed by removing all the framework linkings. In addition, some of the
> headers in the precompiled header file is out of date it seems.
> Introspection and osgSim/OpenFlightOptimizer

Hopefully we'll be able to get the XCode generation from CMake working
well enough before OSG-2.8 to enable us to remove all the old hand
maintained XCode and the oddities like the above that go along with
it.

I have been threatening to retire the old XCode directory to the
deprecated section of the OSG svn repository, perhaps now is the time
to do it... it'd help concentrate our efforts of getting Cmake to work
flawlessly and help avoid errors like the above creeping in unnoticed.
 Thoughts OSX users?

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


Re: [osg-users] 2.6 Mac OS X issues and some solutions

2008-09-04 Thread Filip Wänström
Thanks for your reply Robert!

I know of the issues of the Mac and understand the situation. That is one of
the reasons I write to this list: To share my experiences and hopefully help
some other people.

In general I find the Mac environment to be great for my productivity so I
prefer to develop apps there as well. I will probably have to deliver on
Windows and perhaps on linux but I view cross-platform-development as a good
help to find hidden and nasty code :)

Anyway, I hope that the Mac can be a viable platform for Mac OS X and that
Apple fixes some of their more glaring problems soon.

I hope I will be able to contribute in the future.
/Filip


On Thu, Sep 4, 2008 at 11:50 AM, Robert Osfield <[EMAIL PROTECTED]>wrote:

> Hi Filip,
>
> I'm afraid the OSX side is still a bit in flux, do to a range of
> reasons - not all under our control. Apple themselves have thrown a
> couple of spanners in the works when moving from 10.4.x to 10.5.x,
> Xcode have provided not be forward/backwards compatible so the Xcode
> projects can't break quite easily if you don't use the same version
> that the maintainer used and Apple SDK versions also a bit sensitive.
> Cmake is in flux as, and we are also migrating to use Cmake under OSX.
>
> I just so happened to be on OSX 10.5 box yesterday and compiling the
> SVN trunk version of the OSG and encountered problems too.  The
> initial show stopper was that I CMake 2.6.0 hung when running the
> initial cmake or ccmake command.  Moving to Cmake 2.6.1 fixed this
> CMake bug and got the GNUmakefiles built.  The OSG and Present3D then
> built without problems.  I didn't on this occasion test the Xcode
> project build form CMake though.
>
> Since the OSX platform is so much in flux it does require active
> maintenance to keep things working, in facts it probably the platform
> that requires the highest effort maintenance wise, even more than
> windows, yet has a much smaller user base, so for good support it does
> require OSX user to be particularly proactive in helping maintain the
> platform - this includes documentation as much as coding.  This
> applies to the CMake community as well as the OSG community -
> proactive OSX users/maintainers are gold dust!
>
> Robert.
>
> On Thu, Sep 4, 2008 at 10:24 AM, Filip Wänström
> <[EMAIL PROTECTED]> wrote:
> > Hi there!
> >
> > I tried out to run the 2.6 source release on my MacBook Pro (Leopard
> 10.5.4)
> > And run into some issues but it seems that I resolved them in the process
> > and I want to share my experience in order to help others in a similar
> > situation.
> >
> > First:
> >
> > 1. The provided Xcode project is out of date/doesn't work. I didn't
> bother
> > further with that after the initial failure to get it to work.
> > 2. There seems to be no updated info on what to do with the Mac version
> > except that its seems hard, its not supported and Apple has broken binary
> > compatibility going from Tiger to Leopard. Scary stuff. I would have
> stopped
> > here if it wasn't for that I badly want Mac to be a viable development
> > environment for me. Maybe  some old info could be removed and replaced
> with
> > a simple "1.2.3" list of what to do now.
> >
> > Anyway, I decided to go the CMake route even though it's not exactly well
> > documented anywhere (neither osg site or CMake homepage talks much about
> the
> > current status of Mac)
> >
> > In short it worked, but not completely flawlessly. I found the following
> > issues:
> >
> > 1. There is not much documentation (The biggest problem is that a lot of
> > documentation is contradictory or just to old). So it's trial and error
> (and
> > patience).
> > 2. The install script doesn't work since you have to run as root/su to
> > install in /usr/local
> > 3. After install. You need to set OSG_LIBRARY_PATH to the plugin install
> dir
> > 3b. Since this is very far from common practice when it comes to mac I
> think
> > It can be good to provide an example:
> >
> >
> > Recommended:
> > 1. Download source (from svn or zipped, I use OpenSceneGraph-2.6.0 as the
> > example here)
> > 2. Extract
> > 3. Open terminal and go to your newly created directory (something like
> > ~/tmp/OpenSceneGraph-2.6.0)
> > 4. Create a place for building the project (like: ~/tmp/osgbuild)
> > 5. Enter that dir
> > 5. run cmake with the flag -GXcode (cmake -GXcode
> ../OpenSceneGraph-2.6.0)
> > 6. start ccmake to configure further (you probably want to build the
> > examples) (ccmake  ../OpenSceneGraph-2.6.0)
> > 7. In the text-gui of ccmake. make changes like turn on the examples
> build.
> > then configure and generate project (c, g)
> > 8. Start the xcodeproject and build (
> > 9. run the installscript from the command line with su privileges ( or
> login
> > as root user for this task)
> > 10. in order to test examples and make sure that plugins work: set the
> > environment variables:
> > Create a file called .profile in you root.
> > export OSG_LIBRARY_PATH=/usr/local/lib/osgPlugins-2.6.0/

Re: [osg-users] 2.6 Mac OS X issues and some solutions

2008-09-04 Thread Filip Wänström
Hi again, wanted to add that the template xcode "OSG Application" needs to
be updated. (and changed if you want it to work right now)

Since I tried the CMake route that creates regular .so files and headers in
/usr/local instead of creating mac os frameworks the template need to be
changed by removing all the framework linkings. In addition, some of the
headers in the precompiled header file is out of date it seems.
Introspection and osgSim/OpenFlightOptimizer

I willl change the template so it works with libs and am of course willing
to share if anyone want it.

I'm not saying that the template should be changed to using regular libs
instead of frameworks in the long run but for the time being that is the
easiest way for me to start developing on the mac (and get a homey linux
feeling as well..)

I'm not sure what the status is for generating frameworks from the xcode
project that CMake creates. Hopeully this is remedied in a not to far
future. For now, I'm glad that I can use xcode to create osg projects that
works fine.

/Filip

On Thu, Sep 4, 2008 at 11:24 AM, Filip Wänström <[EMAIL PROTECTED]>wrote:

> Hi there!
>
> I tried out to run the 2.6 source release on my MacBook Pro (Leopard
> 10.5.4) And run into some issues but it seems that I resolved them in the
> process and I want to share my experience in order to help others in a
> similar situation.
>
> First:
>
> 1. The provided Xcode project is out of date/doesn't work. I didn't bother
> further with that after the initial failure to get it to work.
> 2. There seems to be no updated info on what to do with the Mac version
> except that its seems hard, its not supported and Apple has broken binary
> compatibility going from Tiger to Leopard. Scary stuff. I would have stopped
> here if it wasn't for that I badly want Mac to be a viable development
> environment for me. Maybe  some old info could be removed and replaced with
> a simple "1.2.3" list of what to do now.
>
> Anyway, I decided to go the CMake route even though it's not exactly well
> documented anywhere (neither osg site or CMake homepage talks much about the
> current status of Mac)
>
> In short it worked, but not completely flawlessly. I found the following
> issues:
>
> 1. There is not much documentation (The biggest problem is that a lot of
> documentation is contradictory or just to old). So it's trial and error (and
> patience).
> 2. The install script doesn't work since you have to run as root/su to
> install in /usr/local
> 3. After install. You need to set OSG_LIBRARY_PATH to the plugin install
> dir
> 3b. Since this is very far from common practice when it comes to mac I
> think It can be good to provide an example:
>
>
> Recommended:
> 1. Download source (from svn or zipped, I use OpenSceneGraph-2.6.0 as the
> example here)
> 2. Extract
> 3. Open terminal and go to your newly created directory (something like
> ~/tmp/OpenSceneGraph-2.6.0)
> 4. Create a place for building the project (like: ~/tmp/osgbuild)
> 5. Enter that dir
> 5. run cmake with the flag -GXcode (cmake -GXcode ../OpenSceneGraph-2.6.0)
> 6. start ccmake to configure further (you probably want to build the
> examples) (ccmake  ../OpenSceneGraph-2.6.0)
> 7. In the text-gui of ccmake. make changes like turn on the examples build.
> then configure and generate project (c, g)
> 8. Start the xcodeproject and build (
> 9. run the installscript from the command line with su privileges ( or
> login as root user for this task)
> 10. in order to test examples and make sure that plugins work: set the
> environment variables:
> Create a file called .profile in you root.
> export OSG_LIBRARY_PATH=/usr/local/lib/osgPlugins-2.6.0/
> export OSG_FILE_PATH=/path/to_where/you_put/OpenSceneGraph-Data-2.6.0/
>
> Hope this help some other to shorten the time to get it working on the mac.
>
> Best regards
>
> /Filip Wänström
> Creative Engineer - Visualization
> The Interactive Institute
> Norrköping, Sweden
>
>
>
>
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] 2.6 Mac OS X issues and some solutions

2008-09-04 Thread Robert Osfield
Hi Filip,

I'm afraid the OSX side is still a bit in flux, do to a range of
reasons - not all under our control. Apple themselves have thrown a
couple of spanners in the works when moving from 10.4.x to 10.5.x,
Xcode have provided not be forward/backwards compatible so the Xcode
projects can't break quite easily if you don't use the same version
that the maintainer used and Apple SDK versions also a bit sensitive.
Cmake is in flux as, and we are also migrating to use Cmake under OSX.

I just so happened to be on OSX 10.5 box yesterday and compiling the
SVN trunk version of the OSG and encountered problems too.  The
initial show stopper was that I CMake 2.6.0 hung when running the
initial cmake or ccmake command.  Moving to Cmake 2.6.1 fixed this
CMake bug and got the GNUmakefiles built.  The OSG and Present3D then
built without problems.  I didn't on this occasion test the Xcode
project build form CMake though.

Since the OSX platform is so much in flux it does require active
maintenance to keep things working, in facts it probably the platform
that requires the highest effort maintenance wise, even more than
windows, yet has a much smaller user base, so for good support it does
require OSX user to be particularly proactive in helping maintain the
platform - this includes documentation as much as coding.  This
applies to the CMake community as well as the OSG community -
proactive OSX users/maintainers are gold dust!

Robert.

On Thu, Sep 4, 2008 at 10:24 AM, Filip Wänström
<[EMAIL PROTECTED]> wrote:
> Hi there!
>
> I tried out to run the 2.6 source release on my MacBook Pro (Leopard 10.5.4)
> And run into some issues but it seems that I resolved them in the process
> and I want to share my experience in order to help others in a similar
> situation.
>
> First:
>
> 1. The provided Xcode project is out of date/doesn't work. I didn't bother
> further with that after the initial failure to get it to work.
> 2. There seems to be no updated info on what to do with the Mac version
> except that its seems hard, its not supported and Apple has broken binary
> compatibility going from Tiger to Leopard. Scary stuff. I would have stopped
> here if it wasn't for that I badly want Mac to be a viable development
> environment for me. Maybe  some old info could be removed and replaced with
> a simple "1.2.3" list of what to do now.
>
> Anyway, I decided to go the CMake route even though it's not exactly well
> documented anywhere (neither osg site or CMake homepage talks much about the
> current status of Mac)
>
> In short it worked, but not completely flawlessly. I found the following
> issues:
>
> 1. There is not much documentation (The biggest problem is that a lot of
> documentation is contradictory or just to old). So it's trial and error (and
> patience).
> 2. The install script doesn't work since you have to run as root/su to
> install in /usr/local
> 3. After install. You need to set OSG_LIBRARY_PATH to the plugin install dir
> 3b. Since this is very far from common practice when it comes to mac I think
> It can be good to provide an example:
>
>
> Recommended:
> 1. Download source (from svn or zipped, I use OpenSceneGraph-2.6.0 as the
> example here)
> 2. Extract
> 3. Open terminal and go to your newly created directory (something like
> ~/tmp/OpenSceneGraph-2.6.0)
> 4. Create a place for building the project (like: ~/tmp/osgbuild)
> 5. Enter that dir
> 5. run cmake with the flag -GXcode (cmake -GXcode ../OpenSceneGraph-2.6.0)
> 6. start ccmake to configure further (you probably want to build the
> examples) (ccmake  ../OpenSceneGraph-2.6.0)
> 7. In the text-gui of ccmake. make changes like turn on the examples build.
> then configure and generate project (c, g)
> 8. Start the xcodeproject and build (
> 9. run the installscript from the command line with su privileges ( or login
> as root user for this task)
> 10. in order to test examples and make sure that plugins work: set the
> environment variables:
> Create a file called .profile in you root.
> export OSG_LIBRARY_PATH=/usr/local/lib/osgPlugins-2.6.0/
> export OSG_FILE_PATH=/path/to_where/you_put/OpenSceneGraph-Data-2.6.0/
>
> Hope this help some other to shorten the time to get it working on the mac.
>
> Best regards
>
> /Filip Wänström
> Creative Engineer - Visualization
> The Interactive Institute
> Norrköping, Sweden
>
>
>
>
>
>
> ___
> 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] StereoMode doesn't work.

2008-09-04 Thread Robert Osfield
Hi Martin,

Stereo doesn't work for ABSOLTE_RF as the adjustment to the projection
matrix and view matrix required for the left/right eye offsets will be
discarded.   Basically HUD's don't work in stereo (there is no such
thing as a stereo orthographic view) - you need to position you image
plane objects directly into the 3D scene and manage there positioning.

Robert.

On Thu, Sep 4, 2008 at 10:14 AM, Martin Großer <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I think the problem is the following line:
>
> Camera3->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
>
> When I use RELATIVE_RF the stereo mode works fine.
> But I don't know why?!
> Is it impossible to use ABSOLUTE_RF and a stereo view?
>
> Cheers,
>
> Martin
>
>
> -Ursprüngliche Nachricht-
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Im Auftrag von Martin
> Großer
> Gesendet: Mittwoch, 3. September 2008 10:56
> An: 'OpenSceneGraph Users'
> Betreff: [osg-users] StereoMode doesn't work.
>
> Hello,
>
> I have a little problem with the stereo modus. I want to use the anaglyphic
> stereo mode and it doesn't work, when I define a camera. A little Example:
>
> osg::DisplaySettings::instance()->setStereo(true);
> osg::DisplaySettings::instance()->setStereoMode(osg::DisplaySettings::ANAGLY
> PHIC);
>
>
> That works fine, when I define a viewer and a Scene.
> Now, the anaglyphic doesn't work when I define a camera.
>
>
> osg::ref_ptr camera3 = new osg::Camera();
>
>
> I try to define a new DisplaySettings object.
>
>
> osg::DisplaySettings* ds = new osg::DisplaySettings;
> ds->setStereo(true);
> ds->setStereoMode(osg::DisplaySettings::ANAGLYPHIC);
> camera3->setDisplaySettings(ds);
>
>
> But this test failed.
>
>
> What is my mistake?
>
>
>
> Cheers, Martin
>
> ___
> 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] AnimationPathCallback timeMultiplier

2008-09-04 Thread Ulrich Hertlein
Hi Alan and Robert,

Robert Osfield wrote:
> The sounds very much like a bug where the pause code is being broken
> by changes in the multiplier.  Have a look at the
> AnimationPathCallback implementation to see if you can spot what might
> amiss.

I believe this behaviour is due to the way the animation time is calculated.

It's not incremental (t += dt * timeMultiplier) which would be continuous when 
the
multipler changes, but absolute (t = (Tlast - Tfirst) * timeMultiplier) which 
will jump
when you change the multiplier.

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


Re: [osg-users] BorderWidth

2008-09-04 Thread Robert Osfield
Hi Korolyov, or Ilia? (it's best to sign your emails so we know what
your first name is)

On Thu, Sep 4, 2008 at 9:26 AM, Korolyov Ilia <[EMAIL PROTECTED]> wrote:
> What's the purpose of BorderWidth property in osg::HeightField? I
> looking throught code but can't find any deal this it. What is it for?

The doxygen docs explain:

/** Set the width in number of cells in from the edge that the
height field should be rendered from.
  * This exists to allow gradient and curvature continutity to
be maintained between adjacent HeightField, where
  * the border cells will overlap adjacent HeightField.*/

It's more of an experimental feature though, its not one used widely.

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


Re: [osg-users] Using Kd-tree for spatial data

2008-09-04 Thread Robert Osfield
HI Maruti,

Lots was discussed on osg-users about the KdTree implementation in the
OSG when I intergrated the functionality, so have a look through the
osg-users archives in June and July.   The quick answer is that
KdTree's hang off Drawables, and when do intersection testing first
coarsed grained culling is done by the scene graphs hierachy of
bounding spheres/boxes, then finally fine grained testing is done
against the KdTree hanging of the drawables.

Robert.

On Thu, Sep 4, 2008 at 7:27 AM, maruti borker <[EMAIL PROTECTED]> wrote:
>
> Hello,
>I was amazed to see the development  OSG has made, the
> last version i used it was 2.3.4. Coming to the topic,  i wanted to know how
> a scenegraph was being linked to a kd-tree for finding out intersections. I
> am thinking of an application which needs querying of spatial data, for
> which i thought of using kd-trees , but i also thought of having a
> scenegraph for rendering purposes. I looked at a work "Razor:
> Multi-resolution ray tracing for dynamic environments" by William mark  and
> Warren hunt. They also lazily linked a scene-graoh and a kd-tree. I wanted
> to know how the kd-tree is being linked to a scenegraph in OSG and also
> whether i could actually access the kd-tree for performing algorithms on top
> of it. And also an advice whether using this linkage in OSG is useful for
> storing spatial data. Do mail back incase of any doubts or clarifications .
>
>
> Maruti Borker
> IIIT Hyderabad
> Website:- http://students.iiit.ac.in/~maruti
> Blog:- http://marutiborker.wordpress.com
>
> ___
> 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] VPB error

2008-09-04 Thread Robert Osfield
HI Michael,

There are notes on the virtualplanetbuidler.osgforge.osg front page
that describes with versions of the VPB work with which versions of
OSG.   As always the VPB svn trunk works against the OSG svn trunk,
not OSG 2.6.

Robert.

On Thu, Sep 4, 2008 at 4:00 AM, Michael W. Hall <[EMAIL PROTECTED]> wrote:
> Has there been a new release of VPB?  I built it, but when I try to run
> it I get the following:
>
> osgdem:  error while loading shared libraries:  libvpb.so.8: cannot open
> shared object file:  No such file or directory
>
> Looks as thought something did not install.  Just wondering if someone
> may have some idea.  I got the version of VPB from SVN and it appears to
> build with the OSG that I have, 2.6 RC1.
>
> Thanks,
> Michael
>
>
> ___
> 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] 2.6 Mac OS X issues and some solutions

2008-09-04 Thread Filip Wänström
Hi there!

I tried out to run the 2.6 source release on my MacBook Pro (Leopard 10.5.4)
And run into some issues but it seems that I resolved them in the process
and I want to share my experience in order to help others in a similar
situation.

First:

1. The provided Xcode project is out of date/doesn't work. I didn't bother
further with that after the initial failure to get it to work.
2. There seems to be no updated info on what to do with the Mac version
except that its seems hard, its not supported and Apple has broken binary
compatibility going from Tiger to Leopard. Scary stuff. I would have stopped
here if it wasn't for that I badly want Mac to be a viable development
environment for me. Maybe  some old info could be removed and replaced with
a simple "1.2.3" list of what to do now.

Anyway, I decided to go the CMake route even though it's not exactly well
documented anywhere (neither osg site or CMake homepage talks much about the
current status of Mac)

In short it worked, but not completely flawlessly. I found the following
issues:

1. There is not much documentation (The biggest problem is that a lot of
documentation is contradictory or just to old). So it's trial and error (and
patience).
2. The install script doesn't work since you have to run as root/su to
install in /usr/local
3. After install. You need to set OSG_LIBRARY_PATH to the plugin install dir

3b. Since this is very far from common practice when it comes to mac I think
It can be good to provide an example:


Recommended:
1. Download source (from svn or zipped, I use OpenSceneGraph-2.6.0 as the
example here)
2. Extract
3. Open terminal and go to your newly created directory (something like
~/tmp/OpenSceneGraph-2.6.0)
4. Create a place for building the project (like: ~/tmp/osgbuild)
5. Enter that dir
5. run cmake with the flag -GXcode (cmake -GXcode ../OpenSceneGraph-2.6.0)
6. start ccmake to configure further (you probably want to build the
examples) (ccmake  ../OpenSceneGraph-2.6.0)
7. In the text-gui of ccmake. make changes like turn on the examples build.
then configure and generate project (c, g)
8. Start the xcodeproject and build (
9. run the installscript from the command line with su privileges ( or login
as root user for this task)
10. in order to test examples and make sure that plugins work: set the
environment variables:
Create a file called .profile in you root.
export OSG_LIBRARY_PATH=/usr/local/lib/osgPlugins-2.6.0/
export OSG_FILE_PATH=/path/to_where/you_put/OpenSceneGraph-Data-2.6.0/

Hope this help some other to shorten the time to get it working on the mac.

Best regards

/Filip Wänström
Creative Engineer - Visualization
The Interactive Institute
Norrköping, Sweden
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] AnimationPathCallback timeMultiplier

2008-09-04 Thread Robert Osfield
Hi Alan,

The sounds very much like a bug where the pause code is being broken
by changes in the multiplier.  Have a look at the
AnimationPathCallback implementation to see if you can spot what might
amiss.

Which version of the OSG are you looking at?

Robert.

On Wed, Sep 3, 2008 at 7:46 PM, Dickinson, Alan J.
<[EMAIL PROTECTED]> wrote:
> I have been creating an animation controller which allows the user to start,
> stop and reset the animation being visualized in OSG. I have added speed
> control keys which allow the user to speed up or slow down the simulation by
> changing the timeMultiplier value in the AnimationPathCallback class.
>
>
>
> When I hit the speed up key it changes the timeMultiplier by a small amount
> say 0.05 from the default 1.0 like it should.  But each time I hit the speed
> up key the position of the object being animated jumps ahead more than the
> small amount the speed up should be. When I hit the slow down key which
> subtracts 0.05 from the default 1.0, the position of the object jumps
> backwards in the path. Then continues from that point on at the slower
> speed.
>
>
>
> Is this the correct behavior?
>
>
>
> It does change the speed of the animation either faster or slower but the
> position is jumping at the transition. If I hit the slow down key enough I
> can go back to the beginning of the path.
>
>
>
> What am I doing wrong? Or is there a different way to control the speed of
> an animation ?
>
>
>
> Thanks,
>
>
>
> Alan Dickinson
>
> SAIC Intelligent Systems Applications Division
>
> Sr. Software Engineer
>
> ___
> 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] StereoMode doesn't work.

2008-09-04 Thread Martin Großer
Ok, try it.
But I think the problem is that I set the ReferenceFrame to ABSOLUTE_RF.
I do it because I would like a static camera. When I use RELATIVE_RF, I can
move the camera with my mouse. Or is this a mistake, when I set the
ReferenceFrame?

Martin

-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von Robert
Osfield
Gesendet: Donnerstag, 4. September 2008 11:12
An: OpenSceneGraph Users
Betreff: Re: [osg-users] StereoMode doesn't work.

Hi Martin,

I can't really guess as to whether there is bug in your code, or the
OSG as there is to little provided code context to know what is going
in in your app.   Try modifying an example like osgcompositeviewer to
do what you are after and see if that works, if it doesn't then send
this in to osg-users so that others can recreate the problem.

Robert.

On Wed, Sep 3, 2008 at 9:55 AM, Martin Großer <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have a little problem with the stereo modus. I want to use the
anaglyphic
> stereo mode and it doesn't work, when I define a camera. A little Example:
>
> osg::DisplaySettings::instance()->setStereo(true);
>
osg::DisplaySettings::instance()->setStereoMode(osg::DisplaySettings::ANAGLY
> PHIC);
>
>
> That works fine, when I define a viewer and a Scene.
> Now, the anaglyphic doesn't work when I define a camera.
>
>
> osg::ref_ptr camera3 = new osg::Camera();
>
>
> I try to define a new DisplaySettings object.
>
>
> osg::DisplaySettings* ds = new osg::DisplaySettings;
> ds->setStereo(true);
> ds->setStereoMode(osg::DisplaySettings::ANAGLYPHIC);
> camera3->setDisplaySettings(ds);
>
>
> But this test failed.
>
>
> What is my mistake?
>
>
>
> Cheers, Martin
>
> ___
> 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] Fwd: SKYBOX ?

2008-09-04 Thread Robert Osfield
On Wed, Sep 3, 2008 at 7:27 PM, Jeremy Moles <[EMAIL PROTECTED]> wrote:
> In your defense, however, I'm not able to actually get any test code for
> Extensions working at all. Some of the examples create Extensions
> objects (osgvertexprogram, osgmultitexture), but they never return a
> valid pointer--at least for me.

The Extensions objects will be null until they are first access from a
thread that has a valid graphics context, its only once you have a
graphics context that you can do any OpenGL command including checking
for extensions.

So query the extensions object after realize and you should have success.

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


Re: [osg-users] Correction of wikipage Support/Maths/MatrixTransformations

2008-09-04 Thread Robert Osfield
Hi Matthias,

I've just quickly gone through the page you mention and it looks fine.

As for what convention people use - well it all depends on what your
background is, as to whether you view a vector as a column or a row,
as also the pre/post multiplication.   With the osg vectors are a row,
and the matrices are row major - consistent with how data is actually
stored in OpenGL and OSG.

Robert.

On Wed, Sep 3, 2008 at 7:19 PM, Matthias Bindernagel
<[EMAIL PROTECTED]> wrote:
> Hello,
>
> on the page
> http://www.openscenegraph.org/projects/osg/wiki/Support/Maths/MatrixTransformations
> is stated that one should
>
>>pass this matrix
>>
>>GLfloat ZrotateMatrix[][4] = {
>>  { cosA, -sinA, 0, 0 },
>>  { sinA,  cosA, 0, 0 },
>>  {0,  0,1, 0 },
>>  {0,  0,0, 1 }
>>};
>>
>>to glLoadMatrixf(): and see what happens (g'ahead try it, don't take my word
> for it).
>>Your rotations will be the opposite of what you expect.
>
> Well, the correctness of the result depends on what you expect: OpenGL's
> glLoadMatrixf() and its variants expect a column-major-matrix as parameter
> (see http://www.opengl.org/sdk/docs/man/xhtml/glLoadMatrix.xml); passing a
> row-major-matrix (like done in this example) to glLoadMatrixf() results in a
> transformation described by the transposed matrix-argument. Same holds true
> for the translation described later on the wiki page.
>
> So the results of the allegedly erroneous examples are actually correct,
> regarding the OpenGL documentation and standard maths.
>
>
> Another point I want to mention here is my surprise about the argumentation of
> the matrix-vector-product in OSG:
> Almost every book or website I've read about computer graphics in general and
> some DSL's in particular uses
> V' = M * V
> on a broad basis, where V' is the transformed vector, V is the original vector
> and M descibes the trafo.
>
> One could - like the documentation did - replace this commonly used matrix
> product with W' = W * N, but (at least in my opinion) _must_ mention that:
> 1. W' and W are transposed vectors (that is, they are row vectors, instead of
> widely used column vectors)
> 2. N must not be a common transformation matrix (like the ones mentioned on
> wikipedia or mathworld.wolfram.com), but the transpose of such a matrix.
>
>
> IMHO, the documentation found on that wiki page does need some slight
> corrections, but also a lot of additions to clearly state when to use
> original or transposed transformation matrices.
>
> Regards, Matthias Bindernagel
> ___
> 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] StereoMode doesn't work.

2008-09-04 Thread Martin Großer
Hello,

I think the problem is the following line:

Camera3->setReferenceFrame(osg::Transform::ABSOLUTE_RF);

When I use RELATIVE_RF the stereo mode works fine.
But I don't know why?!
Is it impossible to use ABSOLUTE_RF and a stereo view?

Cheers,

Martin


-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von Martin
Großer
Gesendet: Mittwoch, 3. September 2008 10:56
An: 'OpenSceneGraph Users'
Betreff: [osg-users] StereoMode doesn't work.

Hello,

I have a little problem with the stereo modus. I want to use the anaglyphic
stereo mode and it doesn't work, when I define a camera. A little Example:

osg::DisplaySettings::instance()->setStereo(true);
osg::DisplaySettings::instance()->setStereoMode(osg::DisplaySettings::ANAGLY
PHIC);


That works fine, when I define a viewer and a Scene.
Now, the anaglyphic doesn't work when I define a camera.


osg::ref_ptr camera3 = new osg::Camera();


I try to define a new DisplaySettings object.


osg::DisplaySettings* ds = new osg::DisplaySettings;
ds->setStereo(true);
ds->setStereoMode(osg::DisplaySettings::ANAGLYPHIC);
camera3->setDisplaySettings(ds);


But this test failed.


What is my mistake?



Cheers, Martin

___
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] StereoMode doesn't work.

2008-09-04 Thread Robert Osfield
Hi Martin,

I can't really guess as to whether there is bug in your code, or the
OSG as there is to little provided code context to know what is going
in in your app.   Try modifying an example like osgcompositeviewer to
do what you are after and see if that works, if it doesn't then send
this in to osg-users so that others can recreate the problem.

Robert.

On Wed, Sep 3, 2008 at 9:55 AM, Martin Großer <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have a little problem with the stereo modus. I want to use the anaglyphic
> stereo mode and it doesn't work, when I define a camera. A little Example:
>
> osg::DisplaySettings::instance()->setStereo(true);
> osg::DisplaySettings::instance()->setStereoMode(osg::DisplaySettings::ANAGLY
> PHIC);
>
>
> That works fine, when I define a viewer and a Scene.
> Now, the anaglyphic doesn't work when I define a camera.
>
>
> osg::ref_ptr camera3 = new osg::Camera();
>
>
> I try to define a new DisplaySettings object.
>
>
> osg::DisplaySettings* ds = new osg::DisplaySettings;
> ds->setStereo(true);
> ds->setStereoMode(osg::DisplaySettings::ANAGLYPHIC);
> camera3->setDisplaySettings(ds);
>
>
> But this test failed.
>
>
> What is my mistake?
>
>
>
> Cheers, Martin
>
> ___
> 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] scene graph access in multithreaded mode

2008-09-04 Thread Robert Osfield
Hi Tugkan,

On Wed, Sep 3, 2008 at 9:56 AM, Tugkan Calapoglu <[EMAIL PROTECTED]> wrote:
> I am porting an application from OSG0.99 to latest SVN version.

Wow, climb aboard the time machine :-)

> I have two
> questions (both for CullThreadPerCameraDrawThreadPerContext mode):
>
> 1- Is it safe to make changes in the scene graph outside the frame call
> (without using update etc. callbacks )? Or is the only place where we have
> safe scene graph acess is inside a callback? Mailing list and source code
> reading made me think that outside the frame() should be safe but I am
> getting some crashes. Before delving into my own code I'd like that someone
> confirms this.

Modifying the scene graph outside of the frame call is safe in
SingleThreader, and CullDrawThreadPerCamera threading models as they
don't leave any threads active after the end of the
renderingTraversals() method (called from frame()).

With DrawThreadPerContext and CullThreadPerCamewraDrawThreadPerContext
the draw threads will still be active on completion of the
renderingTraversals(), so if you modifying drawables and state that
the thread is still reading from in the draw traversal you will end up
with problems - and potential crashes.  There is a standard mechanism
to deal with this issue - and that is the renderingTraversals() method
to block till all dynamic objects in the draw traversals have been
dispatched.  The way you tell the draw traversal that an drawable or
stateset will be modified dynamically is to set its data variance to
DYNAMIC.

   drawable->setDataVariance(osg::Object::DYNAMIC);
   stateset->setDataVariance(osg::Object::DYNAMIC);

This is mentioned in the "Quick Start Guide" book, as well as many
times on the osg-users mailing list so have a look through the
archives if you want more background reading.


> 2- Is it ok to change the global state set during rendering outside frame
> call? I have following code runing before frame() is called :
>
> osg::Camera* cam = getViewer()->getView(i)->getCamera();
> cam->getOrCreateStateSet()->clear();
> cam->getOrCreateStateSet()->setGlobalDefaults();
> ... And some other changes ...

Same requirement - if you are modifying the stateset then you'll need
to set its data variance to DYNAMIC.  For a StateSet that decorates
the whole scene graph you'll end you holding back the frame till the
whole scene graph is completed, so it won't have any performance
advantage over CullDrawThreadPerContext.  You can double buffer
objects to allow you to retain the STATIC data variance and keep the
threads overlapping, to do this you do:

osg::Camera* cam = getViewer()->getView(i)->getCamera();
cam->setStateSet() = new StateSet;  // this is where we just use a new
StateSet rather than modify the previous one
cam->getOrCreateStateSet()->setGlobalDefaults();
... And some other changes ...

The draw traversal takes a reference to the StateSet and Drawables so
it's safe to go an remove them from the scene graph outside the
frame() call, this isn't something makes then dynamic so you won't
need to set their data variance to DYNAMIC.

Robert.


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


[osg-users] BorderWidth

2008-09-04 Thread Korolyov Ilia

Hello

What's the purpose of BorderWidth property in osg::HeightField? I
looking throught code but can't find any deal this it. What is it for?

Thanks

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