Re: [osg-users] using VPB to make an earth model

2008-02-08 Thread Michael W. Hall
Philip,

Just wanted to let you know that it appears to be working.  I had the
two tif files that you have and the following BMNG tar which I
extracted:

world.topo.200406.3x21600x21600.panels.jpg.tar

The osgdem program has been generating *.ive files for 4 days now.  I
hope it finishes soon.  These are the 500m images and there are eight of
them that create the image of the entire world.  I am not sure if the
osgdem program is actually using these or not.  

Here is the command I used:

osgdem --bluemarble-west -t ../land_shallow_topo_west.tiff
--bluemarble-east -t ../land_shallow_topo_east.tiff--geocentric -l 12 -o
earth.ive

I got this command from the webpage that I downloaed the tif files from,
www.andesengineering.com/BlueMarbleViewer.  It also stated that the
following example uses Earth as a directory and has the blue marble
images in the directory above the Earth directory.  Then it had the
command I used above following.  Since I am learning could someone tell
me how much data should be generated?  Or can you tell by the command.

Thanks,
Michael


On Sat, 2008-02-02 at 09:58 -0600, Philip Hahn wrote:
> Group,
> 
> I realize Virtual Planet Builder is in a state of flux. Is it possible
> to use either 0.9.1 or 0.9.4 to create an earth model, similar to the
> older version of osgdem?
> 
> I tried last night (tweaking the input syntax which apparently
> changed), but basically got garbage out. Could someone give me a valid
> syntax for such an operation using the land_shallow_topo_west and
> land_shallow_topo_east .tiff's (or recommending a different overlay
> image with a known working syntax)?
> 
> Eventually I'd like a model that has actual terrain heights but for
> now a spheroid with imagery overlay is sufficient!
> 
> Thanks,
> 
> Philip
> ___
> 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] Congratulations ag! OpenSceneGraph Chinese Mirror have been finished , try it.

2008-02-08 Thread FreeSouth
Hello:

Thank you for your attation, and if you need I will try my best to help us 
.Wang Rui is a very smart guy ,*_*.

Thanks all.

I want to know how to applicate a link at openscenegraph.org to osgChina, what 
should I do .

Happy New Year(in China , It is New Year.)

Yang ShiXing

>Hello Wang Rui,

>I want to first say good work to all involved in this Chinese mirror of
>the OSG site, I had a look though I cannot read it, it looks like a
>faithful transition. Great work Yang Shixing and the osgChina team!

>> The NPS tutorials in "Support/Tutorials" have all been modified and 
>> translated. (OSG version 2.2 for most of the chapters) I think it better 
>> than the English ones, which are partly written in OSG 1.2~~ :)

>Yes indeed! Would it be possible for the person(s) who did the
>conversion to contribute back the changes so we can update the English
>versions as well? I imagine most modifications were mostly in the code
>samples, so this should not require much additional translation I hope...

>Thanks, and again good work to all involved!
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Vector/Model data inserts in VPB/OSGDEM terrain.Possible ?

2008-02-08 Thread Wojciech Lewandowski
Thanks,

I am looking for some tool that will cut portions of OSGDEM/VPB terrain tile
meshes for airport models as a terrain postprocessing step.

I thought TDS is aimed at run time terrain modifications - like making
explosion craters or digging trenches. But after brief look at TDS
doumentation I see it may be relevant... I will further check it. Thank You.

Cheers,
Wojtek


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Brian
Sent: Friday, February 08, 2008 6:28 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Vector/Model data inserts in VPB/OSGDEM
terrain.Possible ?


  Have you looked at osgTDS
  http://www.andesengineering.com/Projects/TDS/

  Brian


  On Feb 8, 2008 6:16 AM, Wojciech Lewandowski <[EMAIL PROTECTED]>
wrote:

Hi everyone,

Does VPB (or OSGDEM) allow to make holes in the terrain mesh for high
fidelity vector models ?
If not, maybe you can offer some suggestions how to do it ?

Thanks in advance,
Wojtek Lewandowski






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



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


Re: [osg-users] Vector/Model data inserts in VPB/OSGDEM terrain. Possible ?

2008-02-08 Thread Brian
Have you looked at osgTDS
http://www.andesengineering.com/Projects/TDS/

Brian

On Feb 8, 2008 6:16 AM, Wojciech Lewandowski <[EMAIL PROTECTED]> wrote:

>  Hi everyone,
>
> Does VPB (or OSGDEM) allow to make holes in the terrain mesh for high
> fidelity vector models ?
> If not, maybe you can offer some suggestions how to do it ?
>
> Thanks in advance,
> Wojtek Lewandowski
>
>
>
>
>
>
> ___
> 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] osg python binding

2008-02-08 Thread Cedric Pinson
I have found http://code.google.com/p/osgswig/ to bind osg to python, i 
did not try yet. I would like to know if someone use it on linux.
I would like feedback

Cedric

-- 
+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


Re: [osg-users] to draw landscapes beginning from a matrix

2008-02-08 Thread aurora restivo

Hi!

the image jpg in enclosure, is the result of the terrain that I have 
drawn beginning from the matrix of the altitudes.
I would want to know if a way exists for not visualizing the quotas 
equal to 0.


the source code is found in the file morfologia.txt

Thanks in advance.
Aurora Restivo




Jean-Christophe Lombardo ha scritto:

Hi,

You should have look to the osgshape example source code 
(http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/trunk/examples/osgshape/osgshape.cpp)


jcl




 
 


This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer 
viruses.




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

  


<>int** m= g->leggiFile("morf0.txt");


osg::HeightField* hF = new osg::HeightField();
hF->allocate(296,410);

for(int i=0; i< 410; i++)
{
for(int j=0; j<296 ;j++)
{
if(m[i][j]!=0)
hF->setHeight(j,i, m[i][j]);
else
hF->setHeight(j,i, m[i][j]);
}
}

hF->setXInterval(41.0);
hF->setYInterval(29.6);

osg::Quat* quat=  new osg::Quat(0,0,180,45);
hF->setRotation(*quat); 


osgTerrain::Terrain* terrainNode= new osgTerrain::Terrain();
osgTerrain::HeightFieldLayer* hFLayer= new 
osgTerrain::HeightFieldLayer();

hFLayer->setHeightField(hF);
terrainNode->setElevationLayer(hFLayer);



osg::Geode* geode= new osg::Geode();
osg::ShapeDrawable* draw= new osg::ShapeDrawable(hF);
geode->addDrawable(draw);___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Vector/Model data inserts in VPB/OSGDEM terrain. Possible ?

2008-02-08 Thread Wojciech Lewandowski
Hi,

> Can you please explain more precisely what you intent to do by "making
> holes" in the mesh for "hight fidelity vector models" ?
> Do you want to project a lineset ( aka vector model ) onto your mesh ?

Well... yes, but I don't seek a solution for projecting the model on terrain 
surface and rasterizing it into textures.
What I would like to have is a solution which will cuts underlying terrain 
mesh and removes triangles (whole or portions) below the model.

Thats usual flight simulation task. We have hight detail areas/airport 
models and we want them drawn over terrain without Z-fighting. Typical 
solution  is to remove portions of terrain mesh that lie under our vector 
model.

I asked because I noticed that there was commented out option in OSGDEM for 
loading model data, and noticed that VPB repostiory has some undocumented 
vpbExtrude example so I thought that maybe something like this was already 
done.

Cheers,
Wojtek Lewandowski

> Wojciech Lewandowski a écrit :
>> Hi everyone,
>>
>> Does VPB (or OSGDEM) allow to make holes in the terrain mesh for high
>> fidelity vector models ?
>> If not, maybe you can offer some suggestions how to do it ?
>>
>> Thanks in advance,
>> Wojtek Lewandowski
>>
>>
>>
>>
>>
>> 
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
> -- 
> Remy Deslignes
>
> Ingenieur Developement / Software Engineer
>
> Tel: +33 (0)1.53.90.11.19
>
> ===
> Silicon Worlds S.A.
> 224, rue Saint Denis
> 75002 Paris  France
> Tel: +33 (0)1.53.90.11.11
> Fax: +33 (0)1.53.90.11.12
> http://www.silicon-worlds.fr
> ===
>
>
> ___
> 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] loading animated scene with camera

2008-02-08 Thread Tomas Larsson
Hi all,

I'm trying to use OSG to load a simple 3d scene with an animated cube and a
camera.

I've tried different format like collada and osg (exported from max with
osgExp) But in all cases the camera in the scene is ignored.

This happens in both my own test app and in the osgviewer app. Anyone know
why this happens? And how do I make osg use camera in scene?

 

Tomas

 

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


[osg-users] Issues with osgdistortion --dome

2008-02-08 Thread Pete CArss
Hello All,

I'm using 'osgdistorion --dome', and derivatives on Ubuntu Gutsy, with  
OSG 2.2 from mekensleep. I'm using this on a Dell Precision with a  
Quadro 3450, an HP laptop with a Quadro 1600M and recently a Core 2  
Quad in an Asus Striker Extreme, with a Quadro 3500.

The Dell and HP work fine, have never not worked. The Core 2 Quad, can  
only manage < 8 fps. If I remove the "--dome" switch all works fine...

Any clues?

Pete

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


Re: [osg-users] Congratulations ag! OpenSceneGraph Chinese Mirror have been finished , try it.

2008-02-08 Thread Jean-Sébastien Guay
Hello Wang Rui,

> Codes from "14.1 Shaders Introduction" to "18.1 Node Mask Demo"(7 files) 
> and all the texts are modified by me. Some of the chapters have 
> been completely rewrote, e.g "12. Two cameras".
> I will be very glad to help update the English versions. Should I send a 
> tarball to someone?

If you want to update them yourself (if you have time), on the English 
wiki, the section "Documentation - Tutorials" (the upper part of the 
page) should be the NPS tutorials. To be able to edit the wiki, you can 
login with user "osg" and password "05G" (without quotes, password is 
zero-five-capital G). It seems some of the tutorials have been updated, 
no idea if all of them have...

As for the complete code, I don't even think we have a tarball with all 
the code on the wiki. You could attach that to the tutorials page.

Thanks!

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] Congratulations ag! OpenSceneGraph Chinese Mirror have been finished , try it.

2008-02-08 Thread 王锐
Hi J-S,

Part of the source codes are from the NPS homepage, contributed by Gareth
Roberts.
Codes from "14.1 Shaders Introduction" to "18.1 Node Mask Demo"(7 files) and
all the texts are modified by me. Some of the chapters have been completely
rewrote, e.g "12. Two cameras".
I will be very glad to help update the English versions. Should I send a
tarball to someone?

Thanks for support. :)

Wang Rui

2008/2/8, Jean-Sébastien Guay [EMAIL PROTECTED]:
>
>
> Yes indeed! Would it be possible for the person(s) who did the
> conversion to contribute back the changes so we can update the English
> versions as well? I imagine most modifications were mostly in the code
> samples, so this should not require much additional translation I hope...
>
> Thanks, and again good work to all involved!
>
> 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
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Congratulations ag! OpenSceneGraph Chinese Mirror have been finished , try it.

2008-02-08 Thread Jean-Sébastien Guay
Hello Wang Rui,

I want to first say good work to all involved in this Chinese mirror of
the OSG site, I had a look though I cannot read it, it looks like a
faithful transition. Great work Yang Shixing and the osgChina team!

> The NPS tutorials in "Support/Tutorials" have all been modified and 
> translated. (OSG version 2.2 for most of the chapters) I think it better 
> than the English ones, which are partly written in OSG 1.2~~ :)

Yes indeed! Would it be possible for the person(s) who did the
conversion to contribute back the changes so we can update the English
versions as well? I imagine most modifications were mostly in the code
samples, so this should not require much additional translation I hope...

Thanks, and again good work to all involved!

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] what is better

2008-02-08 Thread Jean-Sébastien Guay
Hello Ahmed,

> What is better for performance (and/or) memory?
>
> 1- Share a sphere geometry between more than one node after transform and 
> scale. 
>Or build a new sphere with the correct size and place.
>   

In general it is preferable to share geometry and use transforms if the 
objects are identical, since this will mean that the vertex data can be 
sent to the video card once and used for both objects. Transforms are 
generally not much of a performance problem since the OpenGL pipeline 
will transform all vertices anyways, so if you add a few transforms, it 
just translates into a few additional matrix multiplications, which the 
hardware is very optimized for.

Though unless your spheres are extremely tessellated (osgOQ demo anyone? 
:-) ) it won't make much difference in this simple case on modern hardware.

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] Congratulations ag! OpenSceneGraph Chinese Mirror have been finished , try it.

2008-02-08 Thread 王锐
Hi all,

It is no doubt a hard work for us.
The NPS tutorials in "Support/Tutorials" have all been modified and
translated. (OSG version 2.2 for most of the chapters) I think it better
than the English ones, which are partly written in OSG 1.2~~ :)
Hope it will help OSG developers of China and all over the world.
Thank you for help and advising. Still many dead-links and unaccountable
words at present.

BTW, another big project for me after the translation of OSGQSG. I really
admire FreeSouth (Yang Shixing) and other guys of osgChina-teams.

Wang Rui


在08-2-8,FreeSouth <[EMAIL PROTECTED]> 写道:
>
> Hello Rebort and all :
>
>   I am sorry for my poor English. I am very delight to tell every one that
> OpenSceneGraph Chinese Mirror have been finished soon, URL:
> www.osgChina.org  yestoday is Chinese new year.
>
>   This website have five blocks.
>
>   1: The pages of www.openscenegraph.org 's wiki , absolutely in Chinese.
>   2: A Chinese WIKI, it includes all the resource in China about OSG,but
> It have nothing now for collecting and finishing it may cost a very long
> time.
>   3: The VR enterprise/Products in China. I plan this block as a display
> platform for Chinese enterprise who uses OSG.
>   4: A OSG training, have been held one times successfully at 2008 Jan
> 15th in BeiJing.
>   5: A bbs URL:bbs.osgChina.org  in Chinese.
>
>   and I want to applicate a  link at 
> www.OpenSceneGraph.org, I don't know how to 
> do it.
>
>   This site have only finished a frame, it will be rich as time goes by.
>
>   Thanks Rebort, and all .
>
> Thank you.
>
>
> --
> 网 易 有 道 英 汉 电 子 词 典 获 2 0 0 7 年 " 电 脑 报 " 免 费 软 件 最 佳 功 能 奖
> 
> ___
> 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] Vector/Model data inserts in VPB/OSGDEM terrain. Possible ?

2008-02-08 Thread Rémy Deslignes
Can you please explain more precisely what you intent to do by "making 
holes" in the mesh for "hight fidelity vector models" ?
Do you want to project a lineset ( aka vector model ) onto your mesh ?

Wojciech Lewandowski a écrit :
> Hi everyone,
>  
> Does VPB (or OSGDEM) allow to make holes in the terrain mesh for high 
> fidelity vector models ?
> If not, maybe you can offer some suggestions how to do it ?
>  
> Thanks in advance,
> Wojtek Lewandowski
>  
>  
>  
>  
>  
> 
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>   


-- 
Remy Deslignes

Ingenieur Developement / Software Engineer 

Tel: +33 (0)1.53.90.11.19

===
 Silicon Worlds S.A.
 224, rue Saint Denis
 75002 Paris  France
 Tel: +33 (0)1.53.90.11.11
 Fax: +33 (0)1.53.90.11.12
 http://www.silicon-worlds.fr
=== 


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


Re: [osg-users] Play MP3 sounds

2008-02-08 Thread Jean-Sébastien Guay
Hello Pedro,

> I am making an application and I would like to play MP3 sounds. Do you 
> know how can it be done? Thanks in advance.

Please start a new thread by starting a new message addressed to 
osg-users@lists.openscenegraph.org instead of replying to another 
message next time. It makes things easier to follow in the mailing list.

As to your question, OSG does not have anything to do with sound itself. 
There are some nodekits that allow playing positional sounds (osgAL I 
think, for example), but if you just want to play sounds with no other 
requirements, you can use any sound library (OpenAL, fmod, etc.). Look 
up their documentation and choose what is best for your needs.

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


[osg-users] Congratulations ag! OpenSceneGraph Chinese Mirror have been finished , try it.

2008-02-08 Thread FreeSouth
Hello Rebort and all :

  I am sorry for my poor English. I am very delight to tell every one that 
OpenSceneGraph Chinese Mirror have been finished soon, URL:www.osgChina.org 
yestoday is Chinese new year.

  This website have five blocks.

  1: The pages of www.openscenegraph.org 's wiki , absolutely in Chinese.
  2: A Chinese WIKI, it includes all the resource in China about OSG,but It 
have nothing now for collecting and finishing it may cost a very long time.
  3: The VR enterprise/Products in China. I plan this block as a display 
platform for Chinese enterprise who uses OSG.
  4: A OSG training, have been held one times successfully at 2008 Jan 15th in 
BeiJing.
  5: A bbs URL:bbs.osgChina.org in Chinese.

  and I want to applicate a  link at www.OpenSceneGraph.org , I don't know how 
to do it.

  This site have only finished a frame, it will be rich as time goes by.

  Thanks Rebort, and all .

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


[osg-users] Vector/Model data inserts in VPB/OSGDEM terrain. Possible ?

2008-02-08 Thread Wojciech Lewandowski
Hi everyone, 

Does VPB (or OSGDEM) allow to make holes in the terrain mesh for high fidelity 
vector models ? 
If not, maybe you can offer some suggestions how to do it ?

Thanks in advance,
Wojtek Lewandowski




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


Re: [osg-users] Looking for CARBON integration example, like osgviewerMFC

2008-02-08 Thread Stephan Maximilian Huber

Hi Adrian,

Adrian Egli OpenSceneGraph (3D) schrieb:


may i do something wrong, or the osgViewer for Carbon is not right, i don't
know. The result should looking like "Bild 3". the "Bild 1" and "Bild 2" are
wrong, or current  state of the integration. (Bild 1 : osg default when
window not moved, Bild 2 after bild moved)

  
I am not sure if your usage-scenario is currently doable with 
GraphicsWindowCarbon. You want to attach a HIView (or what it is called 
in Carbon) , which is part of a window to the osgViewer::Viewer. 
GraphicWindowCarbon owns whole windows, it takes all the place, it eats 
all the events, so other ui-items get lost. It is not designed to handle 
only a view.


The current implementation of GraphicsWindowCarbon does not process any 
events, if it gets a "foreign" window. If you want to install the 
eventhandlers, with a foreign window, set


m_windowData->setInstallEventHandler(true);

This may not work for your settings, because GraphicsWindowCarbon 
installs several event handlers to catch Application-Quit etc.


Perhaps it is the best way to implement your own native 
GraphicsContext-implementation for the plugin-usage or use a 
GraphicsWindowEmbedded and do the handling of the AGLContext yourself.



Hope that helps,

Stephan

(P.S. I am attaching a working example using an external window with 
GraphicsWindowCarbon)
//
//  main.c
//  cefixTemplate
//
//  Created by Stephan Huber on 26.11.06.
//  Copyright __MyCompanyName__ 2006. All rights reserved.
//


#include 
#include 
#include 

int main(int argc, char* argv[])
{

// create the window:

Rect titleRect = {100,100, 600, 800};
OSStatus err = 0;
WindowRef windowPtr;
WindowAttributes attr = (kWindowStandardDocumentAttributes | 
kWindowStandardHandlerAttribute) & ~kWindowResizableAttribute;
err = CreateNewWindow(kDocumentWindowClass, attr, &titleRect, 
&windowPtr);




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

// Init the Windata Variable that holds the handle for the Window to 
display OSG in.
osg::ref_ptr m_windowData 
= new osgViewer::GraphicsWindowCarbon::WindowData(windowPtr);
m_windowData->setInstallEventHandler(true);

// Setup the traits parameters

traits->x = titleRect.left;
traits->y = titleRect.top;
traits->width  = abs(titleRect.right - titleRect.left);
traits->height = abs(titleRect.bottom - titleRect.top);
osg::notify(osg::ALWAYS) << "SIZE=" << traits->width << " x " << 
traits->height << std::endl;

traits->windowDecoration = false;
traits->doubleBuffer = true;
traits->sharedContext = NULL;
traits->setInheritedWindowPixelFormat = false;//true;
traits->inheritedWindowData = m_windowData.get();

// Create the Graphics Context
osg::GraphicsContext* gc = 
osg::GraphicsContext::createGraphicsContext(traits.get());



// Init a new Camera (Master for this View)
osg::Camera* camera = new osg::Camera;

// Assign Graphics Context to the Camera
camera->setGraphicsContext(gc);

// Set the viewport for the Camera
camera->setViewport(new osg::Viewport(0,0, traits->width, 
traits->height));

// Add the Camera to the Viewer
osg::ref_ptr m_osg_simple_viewer = new 
osgViewer::Viewer();
m_osg_simple_viewer->addSlave(camera);
m_osg_simple_viewer->setCamera(camera);

osg::Group* g = new osg::Group();
osg::Geode* geode = new osg::Geode();
geode->addDrawable(new osg::ShapeDrawable(new osg::Box()));
g->addChild(geode);
m_osg_simple_viewer->setSceneData(geode);

m_osg_simple_viewer->realize();

m_osg_simple_viewer->run();


return 0;
}


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


Re: [osg-users] Camera position update

2008-02-08 Thread Rémy Deslignes
I think that the best way is to write a specific MatrixManipulator, or 
re-use (or overwrite) the NodeTrackerManipulator.

Rémy

Janusz a écrit :
> Dear all:
>
>  I am running a galaxy formation visualisation with OSG. Just to 
> simulate and visualize the gravitational effect of 2 closely passing 
> disc-shaped galaxies.
>
> The galaxies are simply a cloud of point sprites packed into a single geode.
>
> While running the simulation, I need to constantly update the camera 
> position to keep/track BOTH galaxies in a single viewport all the time.
>
> What would be the best/efficient way to achieve that?
>
>  
> Regards,
>
> Janusz Goldasz
>
> ---
> [EMAIL PROTECTED]
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> ---
> Orange vous informe que cet  e-mail a ete controle par l'anti-virus mail. 
> Aucun virus connu a ce jour par nos services n'a ete detecte.
>
>
>
>   


-- 
Remy Deslignes

Ingenieur Developement / Software Engineer 

Tel: +33 (0)1.53.90.11.19

===
 Silicon Worlds S.A.
 224, rue Saint Denis
 75002 Paris  France
 Tel: +33 (0)1.53.90.11.11
 Fax: +33 (0)1.53.90.11.12
 http://www.silicon-worlds.fr
=== 


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


Re: [osg-users] How to modify the array of vertex from a Geometry object

2008-02-08 Thread lucas Grijander
Hi!

I add the vbo->dirty() but it doesn't change anything. I had a look to the vbo 
data and it's fine, it changes, but the render is not updated any idea??

regards,

Crisalix.



> From: [EMAIL PROTECTED]
> To: osg-users@lists.openscenegraph.org
> Date: Thu, 7 Feb 2008 23:38:00 +0100
> Subject: Re: [osg-users] How to modify the array of vertexfroma   
> Geometryobject
> 
> Hi,
> 
> I think that the only thing missing is a vbo->dirty()
> 
> Regards
> 
> El jue, 07-02-2008 a las 19:31 +0100, lucas Grijander escribió:
> > Thanks Rubén,
> > 
> > I'm trying to use VBO, but I think something is missing... I added
> > this to the creation of my geometry:
> > 
> > myGeom->setSupportsDisplayList(false);
> > myGeom->setUseDisplayList(false);
> > myVertexBuffer = myGeom->getOrCreateVertexBufferObject();
> > myVertexBuffer->setArray(0,&v);
> > myVertexBuffer->setUsage(GL_STREAM_DRAW_ARB);
> > myGeom->setUseVertexBufferObjects(true);
> > 
> > and then inside the callback I'm try to modify the vertex data:
> > 
> > osg::Vec3Array *test = dynamic_cast > *>(testNx->myVertexBuffer->getArray(0));
> > 
> > for(int i = 0; i < numVertex; i++)
> >  {
> >  NxMat34 pose = listShapes.at(i)->shape->getGlobalPose(); 
> > osg::Vec3f trans = osg::Vec3(pose.t.x,pose.t.y,pose.t.z);
> >  
> >  test->at(i) = trans;
> > } 
> > 
> > but nothing changes in the render the object does not move. Does
> > anybody know what is missing??
> > 
> > thanks in advance
> > 
> > Crisalix.
> > 
> > 
> > 
> > __
> > > From: [EMAIL PROTECTED]
> > > To: osg-users@lists.openscenegraph.org
> > > Date: Wed, 6 Feb 2008 21:33:51 +0100
> > > Subject: Re: [osg-users] How to modify the array of vertex from a
> > Geometry object
> > > 
> > > Hi,
> > > 
> > > Some hints:
> > > 
> > > 1. Be sure that test->size() is equal to numVertex
> > > 
> > > 2. I don't know what the "at" method is, I couldn't find it either
> > on
> > > the TemplateArray class or the std::vector class. Try with the
> > vector []
> > > operator, ie: (*test)[i] = trans
> > > 
> > > 3. If you are updating the vertex data once per frame, don't use
> > display
> > > lists, it is the worst thing that you can ever do! It is cheaper
> > even to
> > > use direct mode. Use vertex buffer objects and configure the VBO
> > > (getOrCreateVertexBufferObject) in streaming mode (GL_STREAM_DRAW).
> > > 
> > > Hope this helps.
> > > 
> > > Regards.
> > > 
> > > Rubén
> > > 
> > > El mié, 06-02-2008 a las 14:08 +0100, lucas Grijander escribió:
> > > > Dear all,
> > > > 
> > > > I have to create a 3D surface, and then such surface will be
> > modified during the application with several deformations. I've tried
> > to create a Geometry object, then I set the VertexArray, and finally
> > inside the render callback I update such vertex with the new ones. I
> > got some errors during the rendering:
> > > > 
> > > > Warning: detected OpenGL error "value not valid" after
> > RenderBin::draw(,)
> > > > 
> > > > Does anyone has an idea of such error? In addition, I'm sure the
> > way I am accessing the vertex is not the right one, anybody knows the
> > best way?
> > > > 
> > > > here is the code:
> > > > 
> > > > 
> > > > //Create the 3D geometry
> > > >
> > -
> > > > osg::Vec3Array(m*n));
> > > > osg::Vec2Array& t = *(new osg::Vec2Array(m*n));
> > > > osg::Vec4Array& col = *(new osg::Vec4Array(1));
> > > > 
> > > > col[0][0] = col[0][1] = col[0][2] = col[0][3] = 1.0f;
> > > > 
> > > > int index = 0;
> > > > for( i = 0; i < m; i++ )
> > > > {
> > > > for(j = 0; j < n; j++)
> > > > {
> > > > v[index][0] = i;
> > > > v[index][1] = 0;
> > > > v[index][2] = j;
> > > > 
> > > > t[index][0] = (float)i/(m-1);
> > > > t[index][1] = (float)j/(n-1);
> > > > 
> > > > index++;
> > > > }
> > > > }
> > > > 
> > > > myGeom = new osg::Geometry;
> > > > 
> > > > myGeom->setVertexArray( &v );
> > > > myGeom->setTexCoordArray( 0, &t );
> > > > 
> > > > myGeom->setColorArray( &col );
> > > > myGeom->setColorBinding( osg::Geometry::BIND_OVERALL );
> > > > 
> > > > for( i = 0; i < m-1; i++ )
> > > > {
> > > > osg::DrawElementsUShort* elements = new
> > osg::DrawElementsUShort(osg::PrimitiveSet::TRIANGLE_STRIP);
> > > > elements->reserve(m*2);
> > > > for( j = 0; j < n; j++ )
> > > > {
> > > > elements->push_back((i+0)*n+j);
> > > > elements->push_back((i+1)*n+j);
> > > > }
> > > > myGeom->addPrimitiveSet(elements);
> > > > }
> > > > 
> > > > 
> > > > osg::Texture2D *tex = new osg::Texture2D;
> > > > 
> > > > tex->setImage(osgDB::readImageFile("Images/breast.png"));
> > > > 
> > > > osg::StateSet *dstate = new osg::StateSet;
> > > > dstate->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
> > > > dstate->setTextureAttributeAndModes(0, tex,
> > osg::StateAttribute::ON );
> > > > dstate->setTextureAttribute(0, new osg::TexEnv );
> > > > 
> > > > myGeom->setStateSet( 

[osg-users] what is better

2008-02-08 Thread Ahmed Nawar
Dear All,

What is better for performance (and/or) memory?

1- Share a sphere geometry between more than one node after transform and 
scale. 
   Or build a new sphere with the correct size and place.


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