[osg-users] computing triangles?

2012-10-12 Thread Akilan Thangamani
Hi 

I got a basic doubt on osg terrain construction. When I create a virtual earth 
with the base layer using bluemarble of 1000m resolution, how many triangular 
polygons are created and what is computation basis for it? 
Is the number varies(computed) to different LOD?

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





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


Re: [osg-users] Releasing Graphics context?

2012-09-13 Thread Akilan Thangamani
Robert,

Actually I m creating new context and assigning to already existing camera. I 
use CompositeViewer. I tried removing camera from the view but the error stands 
still. Let me try out the second one and get back. In case of having just 
Viewer, is there any other way to do it?





Thanks

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





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


Re: [osg-users] Releasing Graphics context?

2012-09-13 Thread Akilan Thangamani
Hi Robert

My OSG version is 3.0.1. 
Is close() the right call to release the context completely?

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





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


[osg-users] Releasing Graphics context?

2012-09-12 Thread Akilan Thangamani
Hi,

My application renders on multiple screens and each attached with seperate 
graphics context. The apps demands addition/removal of any graphics context 
dynamically. Suppose when the context is removed and added subsequently for the 
same screen, it throws msg like unable to makeCurrentContext(...). Following 
to that, I couldn't render anything on to  the screen. To release graphics 
context, I tried context-close().  I am not sure what needs to be done??


Thanks

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





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


Re: [osg-users] Releasing Graphics context?

2012-09-12 Thread Akilan Thangamani
Robert

I have 2 screens to be rendered with texture2D. I created context to each 
screen with appropriate screen id such a way,

osg::ref_ptrpsg::GraphicsContext::Traits traits = new .;
traits-x = 0;
traits-y = 0;
traits-screenNum = 0; //1 for other screen
trait-width = screen_width;
trait-height = screen_height;
trait-doubleBuffer = true;
trait-sharedContext = 0;

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

The gc of each screen is set to a camera and camera as slave to view.
When I render texture to both the screen I get the display fine. As soon as I 
try to remove one of the screen context using gc-close() and recreate again 
for the same screen, I get such an error. Further, I couldn't render any 
texture the updated screen.



Thanks

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





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


[osg-users] Best way of adding more models?

2012-08-29 Thread Akilan Thangamani
Hi

I was trying an application which renders some models on android phone using 
osg. The application requires more number of models to be loaded. As the number 
of models increases the rendering gets slowed down drastically as expected. The 
way I do is that under a group node all other nodes are added as children. As 
all the nodes need to be displayed in all levels(range), I was thinking not to 
use PagedLOD. Is there any better way to organize the structure for better the 
rendering? Grouping the nodes will do better any how??


Thanks

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





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


[osg-users] Geographic earth in OSG?

2012-05-15 Thread Akilan Thangamani
Hi,


I created virtual earth as follows,

osg::Node* createEarth()
{
osg::TessellationHints* hints = new osg::TessellationHints;
hints-setDetailRatio(5.0f);

   
osg::ShapeDrawable* sd = new osg::ShapeDrawable(new 
osg::Sphere(osg::Vec3(0.0,0.0,0.0), osg::WGS_84_RADIUS_POLAR), hints);
   
osg::Geode* geode = new osg::Geode;
geode-addDrawable(sd);
   
std::string filename = 
osgDB::findDataFile(Images/land_shallow_topo_2048.jpg);
geode-getOrCreateStateSet()-setTextureAttributeAndModes(0, new 
osg::Texture2D(osgDB::readImageFile(filename)));
   
osg::CoordinateSystemNode* csn = new osg::CoordinateSystemNode;
csn-setEllipsoidModel(new osg::EllipsoidModel());
csn-addChild(geode);
   
return csn;
   
}

But with the above ellipsoidal model I could not locate any geographic location 
accurately. Means that, not able to locate any position for given latitude and 
longitude accurately. What should be done more?

Thanks

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





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


Re: [osg-users] Geographic earth in OSG?

2012-05-15 Thread Akilan Thangamani
Hi,

True. There is no problem with osgearth as it has well wrapped with projection 
information. I did not face any issue with that. 
But  the samething when tried with OSG alone, i observed some issues.
I put the pbm  this way, suppose for given  latitude and longitude as 11.0 and 
77.0 (to be in radians) and to the resultant (x,y,z) of 
ellipsoid-converLatLonHtToXYZ(..),  an object was attached.  The object 
placement is not exactly over that latitude and longitude. It lies totally 
somewhere else on the globe. I think it is projection issue.
Is anybody tried this out???


Thanks

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





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


[osg-users] IllegalArgumentException?

2012-05-04 Thread Akilan Thangamani
Hi

I compiled osg3.0.1 for android for GLES1. I seleceted avd of Android2.2 with 
API level of 8. There is no problem in starting the emulator.fine.
I also compiled osgAndroidExampleGLES1 without any issue on eclipse. Running 
the application throws the following error, 

05-04 05:38:01.375: D/libEGL(275): egl.cfg not found, using default config
05-04 05:38:01.375: D/libEGL(275): loaded /system/lib/egl/libGLES_android.so
05-04 05:38:01.385: W/EGLview(275): creating OpenGL ES 1 context
05-04 05:38:01.405: W/dalvikvm(275): threadid=7: thread exiting with uncaught 
exception (group=0x4001d800)
05-04 05:38:01.405: E/AndroidRuntime(275): FATAL EXCEPTION: GLThread 8
05-04 05:38:01.405: E/AndroidRuntime(275): java.lang.IllegalArgumentException
05-04 05:38:01.405: E/AndroidRuntime(275):  at 
com.google.android.gles_jni.EGLImpl._eglCreateContext(Native Method)
05-04 05:38:01.405: E/AndroidRuntime(275):  at 
com.google.android.gles_jni.EGLImpl.eglCreateContext(EGLImpl.java:50)
05-04 05:38:01.405: E/AndroidRuntime(275):  at 
osg.AndroidExample.EGLview$ContextFactory.createContext(EGLview.java:103)
05-04 05:38:01.405: E/AndroidRuntime(275):  at 
android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:922)
05-04 05:38:01.405: E/AndroidRuntime(275):  at 
android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1246)
05-04 05:38:01.405: E/AndroidRuntime(275):  at 
android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)

I like to know what went wrong


Thanks

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





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


Re: [osg-users] [build] [Tutorial] Building osgAndroidExampleGLES1/2 on Ubuntu 11.10

2012-05-04 Thread Akilan Thangamani
Hi

I compiled osg3.0.1 for android for GLES1. I seleceted avd of Android2.2 with 
API level of 8. There is no problem in starting the emulator.fine.
I also compiled osgAndroidExampleGLES1 without any issue on eclipse. Running 
the application throws the following error,

05-04 05:38:01.375: D/libEGL(275): egl.cfg not found, using default config
05-04 05:38:01.375: D/libEGL(275): loaded /system/lib/egl/libGLES_android.so
05-04 05:38:01.385: W/EGLview(275): creating OpenGL ES 1 context
05-04 05:38:01.405: W/dalvikvm(275): threadid=7: thread exiting with uncaught 
exception (group=0x4001d800)
05-04 05:38:01.405: E/AndroidRuntime(275): FATAL EXCEPTION: GLThread 8
05-04 05:38:01.405: E/AndroidRuntime(275): java.lang.IllegalArgumentException
05-04 05:38:01.405: E/AndroidRuntime(275): at 
com.google.android.gles_jni.EGLImpl._eglCreateContext(Native Method)
05-04 05:38:01.405: E/AndroidRuntime(275): at 
com.google.android.gles_jni.EGLImpl.eglCreateContext(EGLImpl.java:50)
05-04 05:38:01.405: E/AndroidRuntime(275): at 
osg.AndroidExample.EGLview$ContextFactory.createContext(EGLview.java:103)
05-04 05:38:01.405: E/AndroidRuntime(275): at 
android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:922)
05-04 05:38:01.405: E/AndroidRuntime(275): at 
android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1246)
05-04 05:38:01.405: E/AndroidRuntime(275): at 
android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)

I like to know what went wrong


Thanks

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





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


[osg-users] X11 link for osg compile?

2012-04-22 Thread Akilan Thangamani
Hi

I tried to compile osg 3.0.1. with cygwin. Almost all the dependencies 
installed during cygwin setup including necessary libs of X11.
But the compilation of osgviewer throws the following linker error,


Linking CXX shared library ../../bin/cygosgViewer-80.dll
Creating library file: ../../lib/libosgViewer.dll.a
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0x262):
 undefined reference to `_XFree'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0x2a1):
 undefined reference to `_XGetWindowAttributes'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0x2af):
 undefined reference to `_XVisualIDFromVisual'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0x2dc):
 undefined reference to `_XGetVisualInfo'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0x766):
 undefined reference to `_XInternAtom'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0x784):
 undefined reference to `_XInternAtom'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0x835):
 undefined reference to `_XSendEvent'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0x879):
 undefined reference to `_XMapWindow'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0x90c):
 undefined reference to `_XInternAtom'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0x9f5):
 undefined reference to `_XChangeProperty'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xa6a):
 undefined reference to `_XFlush'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xa7d):
 undefined reference to `_XSync'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xb40):
 undefined reference to `_XMoveResizeWindow'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xb4b):
 undefined reference to `_XFlush'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xb5e):
 undefined reference to `_XSync'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xbca):
 undefined reference to `_XStoreName'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xbf3):
 undefined reference to `_XSetIconName'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xbfe):
 undefined reference to `_XFlush'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xc11):
 undefined reference to `_XSync'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xcbf):
 undefined reference to `_XDefineCursor'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xcca):
 undefined reference to `_XFlush'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xcdd):
 undefined reference to `_XSync'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xe0b):
 undefined reference to `_XCreateBitmapFromData'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xe5f):
 undefined reference to `_XCreatePixmapCursor'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xe73):
 undefined reference to `_XFreePixmap'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xe7e):
 undefined reference to `_XFlush'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xe91):
 undefined reference to `_XSync'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xec3):
 undefined reference to `_XCreateFontCursor'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xef7):
 undefined reference to `_XCreateFontCursor'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xf2b):
 undefined reference to `_XCreateFontCursor'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xf5f):
 undefined reference to `_XCreateFontCursor'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xf93):
 undefined reference to `_XCreateFontCursor'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0xfc7):
 more undefined references to `_XCreateFontCursor' follow
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0x13f5):
 undefined reference to `_XOpenDisplay'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0x1464):
 undefined reference to `_XDisplayName'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0x1541):
 undefined reference to `_XDisplayName'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0x15a6):
 undefined reference to `_XCloseDisplay'
CMakeFiles/osgViewer.dir/GraphicsWindowX11.o:GraphicsWindowX11.cpp:(.text+0x16e3):
 undefined reference to `_XCloseDisplay'

[osg-users] Android on windows?

2012-04-21 Thread Akilan Thangamani
Hi

I gone through many installation procedures of osg with android. All emphasized 
on linux. Nowhere I could find for windows. Can android be configured with 
X-windows system only?



Thanks

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





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


[osg-users] loading to texture memory?

2012-04-11 Thread Akilan Thangamani
Hi,


I have GPU of having 1GB texture memory.
I like to load large volume of data into texture memory( using SetImage()), but 
less than 1GB,  and render part by part of the data for every frame.
Does OSG contains any function call to transfer only portion of texture memory 
to the display?
To my knowledged, SetImage() in osg::Texture2D is the only call to load data 
into texture memory directly, I think?

Thanks

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





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


[osg-users] .ive acronym?

2012-04-06 Thread Akilan Thangamani
hi

I could not find the acronym of .ive. Every where it is said that it is OSG 
truncated binary format. But from where these three letters have been taken??

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





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


[osg-users] geometry indexes?

2012-01-16 Thread Akilan Thangamani
Hi

Is there any easy way to find vertices's index for the shapes like Cone, Cube 
etc., in osg::shape?
Otherwise, should it be done thru graph note book only?

Thanks

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





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


[osg-users] osgQt Multiscreen crashes?

2011-08-19 Thread Akilan Thangamani
Hi,


I have installed osg3.0 on Linux system connected with two monitors
thru separate graphics cards, say screen1 and screen2. 
On screen2 I have my GUI using qt. In the GUI, one of the widgets is made based 
on osgQt to show an osg modal. That model is set with the camera attached with 
the context created using createQtGraphicsContext.

On screen1, I m trying to render a texture created with context based on pure 
osg without Qt. Actually the texture rendering is triggered from the GUI on 
screen2. The application crashes down. If the qtOsg widget on screen2 is 
disabled, the texture is getting rendered. I m not sure what went wrong??

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





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


[osg-users] CullDrawthreading on multicards?

2011-06-02 Thread Akilan Thangamani
Hi,


I am rendering textures on 8 graphics cards, each connected to one monitor.
The cards, ATI Firestream 9250 series, are connected to system through PCI 
extension slots.
If I set CullDrawThreadPerContext to composite viewer, the application crashes 
down.
Its working with SingleThreaded Model, by default, fine.  How to set 
multithreading to my application?


Thank you!

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





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


[osg-users] North compass

2010-10-04 Thread Akilan Thangamani
Hi,


I went through all the discussions on north compass. 
I have  displayed  the discussed code and the way I m making use of it for my 
osgEarth. But it s not working in my case.I m not sure what is to be done.

osg::Matrixd calculatePositionMatrix( const osg::EllipsoidModel* ellipsoid, 
const osg::Vec3d newPosition, const osg::Vec3d oldPosition)

{
osg::Matrixd localToWorld, worldToLocal;

ellipsoid-computeLocalToWorldTransformFromXYZ( 
newPosition[0],newPosition[1],newPosition[2],localToWorld );

worldToLocal = Matrix::inverse( localToWorld );

osg::Vec3d newPosInNewPosLocalCoordSystem = osg::Vec3d( 0,0,0 ); // == 
newPosition * worldToLocal;

osg::Vec3d oldPosInNewPosLocalCoordSystem = oldPosition * worldToLocal;

osg::Vec3d moveInNewPosLocalCoordSystem = newPosInNewPosLocalCoordSystem - 
oldPosInNewPosLocalCoordSystem;

double heading = atan2( 
moveInNewPosLocalCoordSystem[1],moveInNewPosLocalCoordSystem[0] );


// usually pitch in local tangent space can be computed
// like this (radians):
//double pitch = atan2( moveInNewPosLocalCoordSystem[2], hypot( 
moveInNewPosLocalCoordSystem[0], 
//moveInNewPosLocalCoordSystem[1] ));

pitch = 0.0;
double roll = 0.0;

osg::Matrix turnRight90DegreesClockwise = osg::Matrix::rotate( 
osg::DegreesToRadians( -90.0 ), osg::Vec3d( 0,0,1 ) );

osg::Matrix rotateToMatchLocalHeading = osg::Matrix::rotate( heading, 
osg::Vec3d( 0,0,1 ) );

osg::Matrix rotateToMatchLocalPitch = osg::Matrix::rotate( pitch, osg::Vec3d( 
1,0,0 ) );

osg::Matrix rotateToMatchLocalRoll = osg::Matrix::rotate( roll, osg::Vec3d( 
0,1,0 ) );

// So the matrix would be like this:
osg::Matrixd matrix = turnRight90DegreesClockwise * rotateToMatchLocalRoll * 
rotateToMatchLocalPitch * rotateToMatchLocalHeading * localToWorld;

return matrix;
} 

...
...
...

For every FRAME:
...
..
osg::Vec3d newpos=viewer.getCameraManipulator()-getViewPoint();
osg::Matrixd rot=calculatePositionMatrix(ellip_model, newpos, oldpos);
compassMT-preMult(rot);
oldpos=newpos;
.



Thanks,
A. Akilan

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





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


[osg-users] context on different graphics cards?

2010-08-25 Thread Akilan Thangamani
Hi,

I have put two graphics cardsin my system  from different vendors. One is of 
ATI and another one is  from nVidia. Using ATI  I drive 2 monitors and able to 
create 2 graphics contexts in my osg application, each to one screen. In the 
same application I m not able to create graphics context for nVidia card which 
is connected to another 3rd monitor.  createGraphicsContext() fails. I m not 
sure what needs to be done.

Thank you!

Cheers,
Akilan

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





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


Re: [osg-users] context on different graphics cards?

2010-08-25 Thread Akilan Thangamani
yes. I m trying it out on windows 7 only.

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





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


[osg-users] synchronizing multi rendering?

2010-07-10 Thread Akilan Thangamani
Hi,

I have multi display set up in a way one graphics card to each monitor.
I created one context to each screen and framing one texture to each and 
rendering. The rendering I do in a loop(1..NSCREEN). Display is happening 
perfectly as stream of video in parallel. After some time, the displays are not 
getting synchronized with each other. Means that one is going bit ahead of 
another one. Even though I set my composite viewer with single threaded, I dnt 
understand why this happens so? I m not sure what needs to be done.

Akilan

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





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


[osg-users] Texture rendering performance issue

2010-07-02 Thread Akilan Thangamani
Hi,



   My system is connected with AMD Firestream 9250 having 1GB 
of card memory. I do some of GPGPU computations on the card. 
At the same time, using OSG I do texture rendering as a stream, in parallel. 
The rendering of texture effects performance down for GPGPU computation. I dont 
understand how does just rendering creates huge impact while the render texture 
size is not more than 1920 * 1200(my screen size) as I have 1GB of card memory. 
Is there anyway for optimal rendering of texture?



Thank you!

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





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


[osg-users] osgwidget with texture setting?

2010-05-11 Thread Akilan Thangamani
Hi,

In my application, I created a texture set to the screen size. Ortho camera has 
been created to map the texture entirely to the screen. I had created some 
osgwidget buttons to have some interaction on texture. But the widget buttons 
are, by default, goes behind the texture(in foreground). I m not sure how to 
set the widgets as foreground and textures behind it?


Akilan

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





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


[osg-users] Transformation on osgWidget?

2010-05-09 Thread Akilan Thangamani
Hi,

I had installed osg2.9.6. osgWidget::Box is being used in my application.
It provides, by default, transformation functionalities.  Regarding rotation, 
it provides setRotation(osgWidget::matrix_type) to do that. But I am not sure 
how to specify the axis about which rotation to be done. I tried in other way 
like MT(rotate)--osgWidget::Box (I m not sure whether it is correct way of 
doing).  But it results nothing.

Thanks

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





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


Re: [osg-users] openGL error with osgEarth?

2010-04-28 Thread Akilan Thangamani
Hi Jason,

In fact, I create the map through program.What the program does is that as and 
when some new tif file arrives at particular folder which I am monitoring 
continuously thru callback, I add the file to the already created map. It works 
well for some 2-3 tile addition. When it goes beyond that it throws the openGL 
error. Have a look at my code. Is there any other way to do the same.

Akilan. A

Code:



class monitorCallback : public osg::NodeCallback
{
public:

monitorCallback(osgEarth* map)
{
_map=map;
}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
//
// look for any new tif arrival at specific folder
//
.
.
if(new_tif)
{
sprintf(name, tile_%d, tif_cnt);
osgEarth::Config conf;
conf.add(url, new_tif);//new tif name with relative 
path
_map-addMapLayer( new osgEarth::MapLayer(name, 
osgEarth::MapLayer::TYPE_IMAGE, gdal, conf ) );
}
   }

osgEarth::Map* _map;
};



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

{

_chdir(curr_dir);
osgViewer::Viewer* viewer=new osgViewer::Viewer;
osg::Group* root=new osg::Group;

osgEarth::Map* map = new 
osgEarth::Map(osgEarth::Map::CSTYPE_GEOCENTRIC);

// Cache
map-setCache(new TMSCache(cache));

// World
   {
  osgEarth::Config conf;
  conf.add( url, ../data/world.tif );
  map-addMapLayer( new osgEarth::MapLayer(WORLD, 
osgEarth::MapLayer::TYPE_IMAGE, gdal, conf ) );

}
  root-setUpdateCallback(new monitorCallback(map));

osgEarth::MapNode* mapNode=new osgEarth::MapNode(map);
mapNode-setNodeMask( 0x01 );
viewer-setCameraManipulator(new osgEarthUtil::EarthManipulator);
viewer-addEventHandler( new osgViewer::StatsHandler() );
viewer-addEventHandler( new osgViewer::ThreadingHandler() );
viewer-setSceneData(root);
viewer-run();
return 0;

} 




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





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


Re: [osg-users] osgEarth fading effect?

2010-04-21 Thread Akilan Thangamani
Robert,

  I set our terrain  as input (output.ive) to the same 
osgmultitexturecontrol example. It is returning false from the function where 
node to the type of multitexturecontrol  is searched  from our terrain 
i.e.,dynamic_cast to multitexturecontrol is failing.   Expected elevation 
blending/fading layers is not happening. Pls let me understand the problem.

Akilan. A

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





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


Re: [osg-users] osgEarth fading effect?

2010-04-21 Thread Akilan Thangamani
Hi zonk,

To say straghtly, same region has been constituted by multi resolution tiles.
The transition from coarser to better resolution tile will take place based on 
the height we are.   As u said, exactly I like to know  about the LOD popping 
by fadding only. 

Akilan. A

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





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


[osg-users] osgEarth fading effect?

2010-04-15 Thread Akilan Thangamani
Hi robert
   
 true. My imagery tiles have been constructed as layers such a way 
coarser resolution images lies at the top and higher resolution images at 
bottom.When  my scene is zoomed-in, I like to have the appearance of higher 
resolution tiles like fading-in. Is that possible by changing alpha values of 
the tiles?


Akilan. A

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





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


Re: [osg-users] osgEarth fading effect?

2010-04-15 Thread Akilan Thangamani
Hi robert

true. My imagery tiles have been constructed as layers such a way coarser 
resolution images lies at the top and higher resolution images at bottom.When 
my scene is zoomed-in, I like to have the appearance of higher resolution tiles 
like fading-in. Is that possible by changing alpha values of the tiles?


Akilan

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





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


Re: [osg-users] osgEarth fading effect?

2010-04-15 Thread Akilan Thangamani

akilan wrote:
 Hi robert

  true. My imagery tiles have been constructed as layers such a way 
 coarser resolution images lies at the top and higher resolution images at 
 bottom.When  my scene is zoomed-in, I like to have the appearance of higher 
 resolution tiles like fading-in. Is that possible by changing alpha values of 
 the tiles?
 
 Extremely sorry.  Unknowingly new  thread created for this. The same querry 
 added with existing thread
 
 Akilan. A


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





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


[osg-users] osgEarth fading effect?

2010-04-14 Thread Akilan Thangamani
Hi,

  Similar to osgEarth which provides to set fading effect to the terrain 
tiles, could it be is possible to get the same effect directly from osg alone 
and how? Bcoz, to exploit that feature from osgEarth, it puts some constraints 
like the terrainDB should be generated with --terrain options and some other 
split level specifications. By passing all those constraints I wud like to see 
thru my terrainDB with the fading effect. I hope dat dis s not just to do with 
pagedLOD.

Thanks

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





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


Re: [osg-users] Multicard memory allocation?

2010-04-13 Thread Akilan Thangamani
Hi robert,
   Thanks for ur clarification.   In our setup,  all powerwall displays 
are of 1280*1024. I m rendering a texture of 1280*1024 with the cameras 
viewport  set in such a way it will be projected on big screen as 1280*1024. 
That means, as 512*1024 I m creating 3 textures(last one is 256*1024). Each 
texture is set to one context/card and camera.  The offset of each  texture is 
0, 512, 1024 respectively(viewport setup). But  I get display on screen as 3 
textures more space between them as seen in my powerwall display.  I understand 
dat as I set texture to different context, my offset setting goes wrong. But I 
want to make use of all cards available in my system.  What needs to be done to 
get merged single display out of my powerwall display? I attach my code as well 
for the reference.



Code:



#define NSCREEN 3   

#define SCREEN_HEIGHT   1024



//OSG related var

osg::Texture2D* texture[NSCREEN];

osg::ref_ptrosgText::Text  latLonDisp;

osg::Image* image[NSCREEN];

osg::MatrixTransform* mt;

osg::Matrix rotate;

double rot_angle=180.f;



//

//

//  Function Defn: Create tecture to the specified view and width

//

osg::Camera* createTex(int nView, int width)

{

double right = 0.5 * width;

double top = 0.5 * SCREEN_HEIGHT;





osg::Camera* camera = new osg::Camera;

camera-setProjectionMatrix(osg::Matrix::ortho2D(-right, right, -top, 
top));


//camera-setViewMatrixAsLookAt(osg::Vec3(0.0,0.0,0.0),osg::Vec3(0.0,1.0,0.0),osg::Vec3(0.0,0.0,1.0));

camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);

camera-setClearMask(GL_DEPTH_BUFFER_BIT);

camera-setRenderOrder(osg::Camera::POST_RENDER);

camera-setAllowEventFocus(false);



{





osg::Geode* geode = new osg::Geode();

std::string timesFont(fonts/arial.ttf);



osg::StateSet* stateset = geode-getOrCreateStateSet();

stateset-setMode(GL_LIGHTING,osg::StateAttribute::OFF);

{

osg::Geometry* geom = new osg::Geometry;

osg::Vec3Array* vertices = new osg::Vec3Array;



vertices-push_back(osg::Vec3(-right, top,0.f));

vertices-push_back(osg::Vec3(-right, -top,0.f));   

vertices-push_back(osg::Vec3(right, -top, 0.f));

vertices-push_back(osg::Vec3(right, top, 0.f));



   geom-setVertexArray(vertices);



osg::Vec2Array* texcoords = new osg::Vec2Array(4);



(*texcoords)[0].set(0.0f,1.0f);

(*texcoords)[1].set(0.0f,0.0f);

(*texcoords)[2].set(1.0f,0.0f);

(*texcoords)[3].set(1.0f,1.0f);



geom-setTexCoordArray(0,texcoords);





osg::Vec3Array* normals = new osg::Vec3Array;

normals-push_back(osg::Vec3(0.0f,0.0f,1.0f));  

geom-setNormalArray(normals);

geom-setNormalBinding(osg::Geometry::BIND_OVERALL);



osg::Vec4Array* colors = new osg::Vec4Array;

colors-push_back(osg::Vec4(1.0f,1.0,1.0f,1.0f));

geom-setColorArray(colors);

geom-setColorBinding(osg::Geometry::BIND_OVERALL);



geom-addPrimitiveSet(new osg::DrawArrays(GL_QUADS,0,4));



texture[nView] = new osg::Texture2D;

texture[nView]-setName(TEXTURE); 

texture[nView]-setDataVariance(osg::Object::DYNAMIC); // protect 
from being optimized away as static state.

texture[nView]-setResizeNonPowerOfTwoHint(false);



// Setting buffer

image[nView] = new osg::Image; 

image[nView]-setName(BUFFER);

image[nView]-setOrigin(osg::Image::BOTTOM_LEFT); 

image[nView]-setImage(width, SCREEN_HEIGHT, 1, GL_LUMINANCE, 
GL_LUMINANCE, GL_UNSIGNED_BYTE,buf[nView], osg::Image::NO_DELETE);  
  

texture[nView]-setImage(image[nView]); 





osg::StateSet* stateset = geom-getOrCreateStateSet();


stateset-setTextureAttributeAndModes(0,texture[nView],osg::StateAttribute::ON);


stateset-setMode(GL_BLEND,osg::StateAttribute::ON);

stateset-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);



// Rotate the texture to 180 degree

mt = new osg::MatrixTransform;  


//rotate.makeRotate(osg::inDegrees(0.0), 1.0, 0.0, 0.0);

mt-setMatrix(osg::Matrix::rotate(osg::inDegrees(rot_angle), 1.0, 
0.0, 0.0));

mt-addChild(geode);

   geode-addDrawable(geom);

  }

camera-addChild(mt);

}



return camera;

}



void main()

{



{

// construct the viewer.

osgViewer::CompositeViewer viewer;



// create the main 

[osg-users] Multicard memory allocation?

2010-04-09 Thread Akilan Thangamani
Hi,

I have multiple graphics cards in my system and connected to different display. 
I created multiple views(composite viewer) so that each view to one context. 
Each view has its own camera projecting its own texture (similar to osgHud 
example). My assumption is that each texture occupies the memory from 
respective graphics cards referred to by the context. Is that correct? or Will 
they create space on one card only? 
Second,  How to do multi-pipe rendering? Bcoz I have another configuration like 
Multiple graphics cards---3 Projectors--1 screen(1280*1024) in which I 
wud like to render my scene.

Akilan

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





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


[osg-users] osgText and Texture

2010-04-01 Thread Akilan Thangamani
Hi,



I created a texture and  set to a camera.  Another camera was set to a text.  
Text and the  texture are in different views.  Always the text goes behind the 
texture.  What needs to be done to make the text appear always in front? I 
tried by setting the texture state's  rendering hint as TRANSPARENT. But couldn 
't any change.

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





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


Re: [osg-users] osgText and Texture

2010-04-01 Thread Akilan Thangamani
Hi robert,

True. I do follow the osgHud example. But I am trying to display lat, lon 
values as text on mouse move over texture set from buffer. Anyway we use our 
own tranformation. But I couldn 't set the transparency. Have a look @ my code 
and let me get the mistake i do.



Code:


osg::Camera* createTex()
{   
   osg::Group* group=new osg::Group;

   osg::Geometry  *geom;
   osg::Camera* camera = new osg::Camera;

camera-setProjectionMatrix(osg::Matrix::ortho2D(0,1920,0,1200));
camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
camera-setViewMatrix(osg::Matrix::identity());
camera-setClearMask(GL_DEPTH_BUFFER_BIT);
camera-setRenderOrder(osg::Camera::POST_RENDER);
camera-setAllowEventFocus(true);

{

osg::Vec3 top_left(0.0f ,0.0f ,1200.0f);
osg::Vec3 bottom_left(0.0f ,0.0f ,0.0f);
osg::Vec3 bottom_right(1920.0f ,0.0f, 0.0f);
osg::Vec3 top_right(1920.0f, 0.0f, 1200.0f);

geom = new osg::Geometry;


osg::Vec3Array* vertices = new osg::Vec3Array(4);



(*vertices)[0] = top_left;
(*vertices)[1] = bottom_left;
(*vertices)[2] = bottom_right;  
(*vertices)[3] = top_right;
geom-setVertexArray(vertices);


osg::Vec2Array* texcoords = new osg::Vec2Array(4);

(*texcoords)[0].set(0.0f,1.0f);
(*texcoords)[1].set(0.0f,0.0f);
(*texcoords)[2].set(1.0f,0.0f);
(*texcoords)[3].set(1.0f,1.0f);

geom-setTexCoordArray(0,texcoords);

osg::Vec3Array* normals = new osg::Vec3Array(1);

(*normals)[0].set(0.0f,0.0f,1.0f);
geom-setNormalArray(normals);
geom-setNormalBinding(osg::Geometry::BIND_OVERALL);

osg::Vec4Array* colors = new osg::Vec4Array(1);
(*colors)[0].set(1.0f,1.0f,1.0f,0.2f);
geom-setColorArray(colors);
geom-setColorBinding(osg::Geometry::BIND_OVERALL);

geom-addPrimitiveSet(new osg::DrawArrays(GL_QUADS,0,4));

osg::Geode* geom_geode = new osg::Geode;
geom_geode-addDrawable(geom);


texture = new osg::Texture2D;
texture-setName(TEXTURE);
texture-setDataVariance(osg::Object::DYNAMIC); 
texture-setResizeNonPowerOfTwoHint(false);

// Setting buffer
osg::Image* image = new osg::Image; 
image-setName(BUFFER);
image-setOrigin(osg::Image::BOTTOM_LEFT); 
image-setImage(buf_width, buf_height, 1, GL_LUMINANCE, 
GL_LUMINANCE, GL_UNSIGNED_BYTE,buf, osg::Image::NO_DELETE); 

texture-setImage(image);   
osg::StateSet* stateset = geom-getOrCreateStateSet();

stateset-setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON);   

stateset-setMode(GL_LIGHTING, osg::StateAttribute::OVERRIDE | 
osg::StateAttribute::OFF);
stateset-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
camera-addChild(geom_geode);
}

return camera;
}

osg::Node* createLatLonLabel()
{
osg::Group* root=new osg::Group;

osg::Camera* camera = new osg::Camera;
root-addChild(camera);

camera-setProjectionMatrix(osg::Matrix::ortho2D(0,1920,0,1200));
camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
camera-setViewMatrix(osg::Matrix::identity());
camera-setClearMask(GL_DEPTH_BUFFER_BIT);
camera-setRenderOrder(osg::Camera::POST_RENDER);   
camera-setAllowEventFocus(true);

{   
osg::Geode* geode = new osg::Geode();
std::string timesFont(fonts/arial.ttf);
osg::StateSet* stateset = geode-getOrCreateStateSet();

stateset-setMode(GL_LIGHTING, osg::StateAttribute::OVERRIDE | 
osg::StateAttribute::OFF);
stateset-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
stateset-setMode(GL_LIGHTING,osg::StateAttribute::OFF);
osg::Vec3 position(0.0f,0.0f,0.0f);   

{
latLonDisp = new  osgText::Text;
geode-addDrawable( latLonDisp );

latLonDisp-setFont(timesFont);
latLonDisp-setCharacterSize(15);
latLonDisp-setFontResolution(25,25);
latLonDisp-setPosition(position);
latLonDisp-setText((0,0));
latLonDisp-setAlignment(osgText::Text::CENTER_TOP);
latLonDisp-setAxisAlignment(osgText::Text::XY_PLANE);  

}   
camera-addChild(geode);
}

return root;
}

[osg-users] Setting camera to texture

2010-03-26 Thread Akilan Thangamani
Hi,

My screen resolution is 1920*1200 and I rendered a texture with the geometry as 
 top_left(0.0,1.2), top_right(1.92, 1.2), bottom_left(0.0, 0.0) and 
bottom_right(1.92, 0.0). Camera is set as,

...
..
camera-setViewPort(0,0, 1920, 1200);
camera-setProjectionMatrix(osg::Matrix::Ortho2D(0,1920,0,1200));
...
..
But I dont understand why the texture is not fitting exactly onto the screen?

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





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


Re: [osg-users] Setting camera to texture

2010-03-26 Thread Akilan Thangamani
Hi,

The code written is,
.

int numCameras=2;
int numScreens=2;

int width=1920 * numScreens;
int height=1200;

void setView(osgViewer::View* view, int screen_no)
{
double aspectRatioScale = 1.0; 
osg::ref_ptrosg::GraphicsContext::Traits traits = new 
osg::GraphicsContext::Traits;
traits-screenNum =  screen_no;
traits-x = (screen_no*width)/numCameras;
traits-y = 0;
traits-width = width/numCameras-1;
traits-height = height;
traits-windowDecoration = true;
traits-doubleBuffer = true;
traits-sharedContext = 0;

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

osg::ref_ptrosg::Camera camera = new osg::Camera;
camera-setGraphicsContext(gc.get());
camera-setViewport(new osg::Viewport(0,0, width/numCameras, height));

camera-setProjectionMatrix(osg::Matrix::ortho2D(0.0,1920,0.0,1200));
camera-setViewMatrix(osg::Matrix::identity());
camera-setClearMask(GL_DEPTH_BUFFER_BIT);

GLenum buffer = traits-doubleBuffer ? GL_BACK : GL_FRONT;
camera-setDrawBuffer(buffer);
camera-setReadBuffer(buffer);  
view-addSlave(camera.get(), osg::Matrix::scale(aspectRatioScale, 1.0, 
1.0)*osg::Matrix::translate(translate_x, 0.0, 0.0), osg::Matrix() );
}

..

main()
{
.
// view 1
{
osg::Group* scene=new osg::Group;
scene-addChild(createTex());//1920 * 1200

osgViewer::View* view = new osgViewer::View;
view-setSceneData(scene);  
setView(view, 0);

view-setCameraManipulator(tm);
viewer.addView(view);   
}

// view 2
{
osg::Group* scene=new osg::Group;
scene-addChild(createTex());//1920 * 1200

osgViewer::View* view = new osgViewer::View;
view-setSceneData(scene);  
setView(view, 1);

view-setCameraManipulator(tm);
viewer.addView(view);   
}
.
}

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





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


Re: [osg-users] Setting camera to texture

2010-03-26 Thread Akilan Thangamani
Hi Nick

Find my code below to compile,


Code:


#include osg/Node
#include osg/Geometry
#include osg/Notify
#include osg/MatrixTransform
#include osg/Texture2D
#include osg/DrawPixels
#include osg/PolygonOffset
#include osg/Geode
#include osgDB/Registry
#include osgDB/ReadFile
#include osgText/Text
#include osgViewer/Viewer
#include osgViewer/CompositeViewer
#include osgViewer/ViewerEventHandlers
#include osgGA/StateSetManipulator
#include osgGA/TrackballManipulator
#include iostream.h

#undef MULTI_SCREEN

#define NUM_CAMERA  1
#define NUM_SCREEN  1


unsigned char  *buf_1, *buf_2, *buf_3, *buf_4;
int buf_width=1920, buf_height=1200;
unsigned int numCameras = NUM_CAMERA;
unsigned int numScreens = NUM_SCREEN;


int width=1920 * NUM_SCREEN;
int height=1200;
int read_off=0;


osg::ref_ptrosg::Image image;
osg::Texture2D *texture[4];
osg::Geometry  *geom[4];



void initRead(char* fname, int w, int h)
{
buf_1=new unsigned char[buf_width * buf_height];
buf_2=new unsigned char[buf_width * buf_height];
buf_3=new unsigned char[buf_width * buf_height];
buf_4=new unsigned char[buf_width * buf_height];

memset((unsigned char*)buf_1,(unsigned char)128,buf_width * buf_height);
memset((unsigned char*)buf_2,(unsigned char)160,buf_width * buf_height);
memset((unsigned char*)buf_3,(unsigned char)180,buf_width * buf_height);
memset((unsigned char*)buf_4,(unsigned char)200,buf_width * buf_height);
}

osg::Node* createTex(int index, unsigned char* buf)
{
osg::Group* group=new osg::Group;

osg::Vec3 top_left(0.0f ,0.0f ,height);
osg::Vec3 bottom_left(0.0f ,0.0f ,0.0f);
osg::Vec3 bottom_right(width ,0.0f, 0.0f);
osg::Vec3 top_right(width, 0.0f, height);

geom[index] = new osg::Geometry;


osg::Vec3Array* vertices = new osg::Vec3Array(4);
(*vertices)[0] = top_left;
(*vertices)[1] = bottom_left;
(*vertices)[2] = bottom_right;  
(*vertices)[3] = top_right;
geom[index]-setVertexArray(vertices);


osg::Vec2Array* texcoords = new osg::Vec2Array(4);

(*texcoords)[0].set(0.0f,1.0f);
(*texcoords)[1].set(0.0f,0.0f);
(*texcoords)[2].set(1.0f,0.0f);
(*texcoords)[3].set(1.0f,1.0f);

geom[index]-setTexCoordArray(0,texcoords);

osg::Vec3Array* normals = new osg::Vec3Array(1);
(*normals)[0].set(1.0f,0.0f,0.0f);
geom[index]-setNormalArray(normals);
geom[index]-setNormalBinding(osg::Geometry::BIND_OVERALL);

osg::Vec4Array* colors = new osg::Vec4Array(1);
(*colors)[0].set(1.0f,1.0f,1.0f,1.0f);
geom[index]-setColorArray(colors);
geom[index]-setColorBinding(osg::Geometry::BIND_OVERALL);

geom[index]-addPrimitiveSet(new osg::DrawArrays(GL_QUADS,0,4));

osg::Geode* geom_geode = new osg::Geode;
geom_geode-addDrawable(geom[index]);


texture[index] = new osg::Texture2D;
texture[index]-setName(TEXTURE);
texture[index]-setDataVariance(osg::Object::DYNAMIC); // protect from 
being optimized away as static state.
texture[index]-setResizeNonPowerOfTwoHint(false);

// Setting buffer
image = new osg::Image; 
image-setName(BUFFER);
image-setOrigin(osg::Image::BOTTOM_LEFT); 
image-setImage(buf_width, buf_height, 1, GL_LUMINANCE, GL_LUMINANCE, 
GL_UNSIGNED_BYTE,buf, osg::Image::NO_DELETE); 

texture[index]-setImage(image);


osg::StateSet* stateset = geom[index]-getOrCreateStateSet();

stateset-setTextureAttributeAndModes(0,texture[index],osg::StateAttribute::ON);
stateset-setMode(GL_LIGHTING,osg::StateAttribute::OFF);

group-addChild(geom_geode);

return group;
}

void setView(osgViewer::View* view, int screen_no)
{

double aspectRatioScale = 1.0; 
osg::ref_ptrosg::GraphicsContext::Traits traits = new 
osg::GraphicsContext::Traits;
traits-screenNum =  screen_no;
traits-x = (screen_no*width)/numCameras;
traits-y = 0;
traits-width = width/numCameras-1;
traits-height = height;
traits-windowDecoration = true;
traits-doubleBuffer = true;
traits-sharedContext = 0;

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

osg::ref_ptrosg::Camera camera = new osg::Camera;
camera-setGraphicsContext(gc.get());
camera-setViewport(new osg::Viewport(0,0, width/numCameras, height));


camera-setProjectionMatrix(osg::Matrix::ortho2D(0,1920,0,1200));
camera-setViewMatrix(osg::Matrix::identity());
camera-setClearMask(GL_DEPTH_BUFFER_BIT);

GLenum buffer = traits-doubleBuffer ? GL_BACK : GL_FRONT;
camera-setDrawBuffer(buffer);
camera-setReadBuffer(buffer);  
view-addSlave(camera.get(), osg::Matrix::scale(aspectRatioScale, 1.0, 
1.0)*osg::Matrix::translate(0.0, 0.0, 0.0), osg::Matrix() );
}

int main(int , char **)
{

[osg-users] GraphicsContext on Multiple Graphics cards?

2010-03-24 Thread Akilan Thangamani
Hi,


4 graphics cards have been installed in my system thru PCI extension board. 
In my application I want to associate individual camera with each context 
created on each card. I wud like to know  how  to create context for specific 
graphics card/display.

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





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


[osg-users] positioning osg model at lat, lon

2010-03-23 Thread Akilan Thangamani
Hi,

I tried to place cessna model at given latitude and longitude on a earth model 
created by geotiff earth file warped over sphere (similar to the example 
osgSimulation). But the model is positioned at some strange place. The way I do 
placing is,

...
.
osg::Node* cessna = osgDB::readNodeFile(cessna.osg);
if (cessna)
{
double s = 20.0 / cessna-getBound().radius();

osg::MatrixTransform* scaler = new osg::MatrixTransform;
scaler-addChild(cessna);
scaler-setMatrix(osg::Matrixd::scale(s,s,s)*osg::Matrixd::rotate(rotation));
scaler-getOrCreateStateSet()-setMode(GL_RESCALE_NORMAL,osg::StateAttribute::ON);

osg::MatrixTransform* mt = new osg::MatrixTransform;
mt-addChild(scaler);


 rot.makeRotate(osg::DegreesToRadians(90.0),0.0,0.0,1.0);

...
osg::EllipsoidModel* ellipsoid = csn-getEllipsoidModel();
if (ellipsoid)
{
osg::Matrixd matrix;

lat=11.0;
lon=78.0;
ht=100.0 * 1000.0;


ellipsoid-computeLocalToWorldTransformFromLatLongHeight(lat,long,ht,matrix);
matrix.preMultRotate(rot);
mt-setMatrix(matrix);
}

csn-addChild(mt);
...


The coordinate system node is of the earth file (Geotif). I wud like to know 
the mistake I do.

Thanks

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





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


Re: [osg-users] Multi screen display issue

2010-03-16 Thread Akilan Thangamani
Hi,

Actually I like to display a big video stream in original resolution, 3840 * 
1 (width * height). The video will run contiguously upward covering the 
width resolution as it is. We don't want to configure Xinerama due to some 
other reasons.  But when we run osgviewer to display some of the example 
models, it is automatically picking up both the monitors. I wud like to 
understand it. 

Thanks

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





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


Re: [osg-users] Display from buffer

2010-03-15 Thread Akilan Thangamani
Hi,

Thanks. It's working fine.

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





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


[osg-users] Multi screen display issue

2010-03-15 Thread Akilan Thangamani
Hi,

I connected 2 monitors to my graphics card in such a way dat my desktop  
resolution is expanded doubly( width wise).  My osg application  renders  a 
texture on both the screen  contiguously by setting 2 seperate cameras for each 
screen,  in the same way specified in osgCamera example.  Everything is working 
fine both on windows and linux. In linux we configured the two monitors  in 
such a way dat both having its own desktop and  resolution. 
Now  the same application is rendering only  on one screen. what needs to be 
done?

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





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


[osg-users] Display from buffer

2010-03-10 Thread Akilan Thangamani
Hi,


For displaying any .jpg/.tif file, we create texture and then doing so.
Using OSG how to display pixels from a buffer straightaway as it could be done 
using openGL?
Is it possible to by-pass osgDB::readImageFile(..) to read image content from 
buffer instead of from file?

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





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


Re: [osg-users] Display from buffer

2010-03-10 Thread Akilan Thangamani
Thanks.

Yes. I m using osg::Image to set my pixel buffer.   I set GL_LUMINANCE as 
internal pixel format. But I m getting only black image. My code looks like 
this,


..
unsigned char* data;
int width, height;
width=4200; //source_image width
height=4710;//source_image height 
long size = width * height;
data = new unsigned char[size]; 

//Reading Image of width * height into buffer



for(i=0;i(width * height); i++)

data[i]=source_image[i]);









//Setting image 

osg::ref_ptrosg::Image image = new osg::Image; 

image-allocateImage(width, height, 1, GL_LUMINANCE, GL_UNSIGNED_BYTE); 

image-setOrigin(osg::Image::BOTTOM_LEFT); 

image-setImage(width, height, 1, GL_LUMINANCE, GL_LUMINANCE, 
GL_UNSIGNED_BYTE,data, osg::Image::NO_DELETE); 
texture-setImage(image);


My another question is, could it possible to display image without scaling 
down/up?

Thanks

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





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


[osg-users] [3rdparty] Config url compile error?

2010-02-23 Thread Akilan Thangamani
Hi,

I have just started working on osgEarth. 
I wrote my first code  with osg2.8.2 to load a map something like
...
#include osgEarth/Config

...
Config conf;
conf[url]=../data/world.tif;
.

Compiling the program  gives an error saying dat ther s no predefinition for 
url.
Other than Config.h any other file has to be included?


Thank you!

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





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


[osg-users] GL_COLOR_MATERIAL setting problem?

2010-02-22 Thread Akilan Thangamani
Hi,


I installed osg 2.8.2 by compiling all 3rd party sources including glut.
I tried to run one of example, osgblendequation, it throws the following error,


Error: Setting mode 'GL_COLOR_MATERIAL' via osg::StateSet::setMode(mode,value) 
ignored.
   The mode 'GL_COLOR_MATERIAL' is set by the osg::Material StateAttribute. 
   Setting this as a mode fools osg's State tracking.
Error: Setting mode 'GL_COLOR_MATERIAL' via osg::StateSet::setMode(mode,value)  
ignored.
  

Is any of glut file missed out in my compilation?


Thank you!

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





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


[osg-users] [osgPlugins] png, tif 3ds files reading problem

2010-02-17 Thread Akilan Thangamani
Hi,
 

Recently I installed osg2.8.2. I compiled the sources (from .svn) successfully. 
 But viewer is saying couldn't find plugin to read .png, tif of 3ds files even 
if osgdb_freetype.dll is in path and created from compilation.
What needs to be done?

Thank you!

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





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


[osg-users] Geotiff rendering?

2010-02-11 Thread Akilan Thangamani
Hi,

Suppose when we add ive tiles to a group and render the group, all the tiles 
are placed
at corresponding places according to their lat and lon. But when I m trying to 
do the same using
just tif files it s not happening so. Instead, multiple tif tiles are overlaid 
one over other. Anyway tif is also having geo details rite?  What needs to be 
done to render tiff just like ive?

Thank you!

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





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


Re: [osg-users] Setting fading property to node

2009-12-04 Thread Akilan Thangamani
Hi,

I tried with the following code to get fading effect from the node  to be 
rendered . I don't get the effect. I wud like to know where I do mistake.
.

.
osg::stateSet* statSet=node-getOrCreateStateSet();
statSet-setMode(GL_LIGHTING, osg::stateAttribute::OFF);
statSet-setMode(GL_BLEND, osg::stateAttribute::ON);
statSet-setRenderingHint(osg::stateSet::TRANSPARENT_BIN);

osg::ref_ptrosg::Material material=new osg::Material;
material-setAlpha(osg::Material::face::FRONT_AND_BACK,0.5);
statSet-setAttribute(material.get());

.
...





Thank you!

Cheers,
Akilan

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





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


[osg-users] Setting fading property to node

2009-12-03 Thread Akilan Thangamani
Hi,

In my terrain I wud like to display the tiles with fading fashion as is 
available in
osgText.Is it possible to do?

Thank you!

Cheers,
Akilan

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





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


[osg-users] smooth layer transistion?

2009-11-11 Thread Akilan Thangamani
Hi,

I  have created a terrain DB with different resolution images covering same 
area.
As and when the region is zoomed in, there is transistion from poor resolution 
image
to higher resolution image. The transition  is quite visible. Means that at 
particular level the entire poor resolution tile disappears and next layer is 
brought up. I would like it to happen so smoothly. Whether do I have to set 
mipmap filter to acquire such smooth transition?

Thank you!

Cheers,
Akilan

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





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


[osg-users] Transforming on coordinate system

2009-09-11 Thread Akilan Thangamani
Hi,

 I have drawn a geometry normal to XY-plane and I would like to transform it in 
such a way that it must be normal to YZ-plane.I did rotation for 90 degree 
about X-axis. Will it do what I wanted to do?  The corresponding code would 
seems to be ,

..

osg::Matrix 
rot=osg::Matrix::rotate(osg::DegreesToRadians(90.),osg::Vec3f(1.0,0.0,0.0));

..



Thank you!

Cheers,
Akilan

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





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


Re: [osg-users] problem in camera rotation

2009-09-10 Thread Akilan Thangamani
Hi,

yeah. I found my geometry center as ( 0.04,0.075,0.0).  So first I do the 
rotation of 90 degree about z-axis and then translating my geometry to 0 by 
subtracting the aboive center values.
Again I m getting  my geometry is translated and half of the geometry is off 
the view. Have a look at my code, I dont understand where I am making mistake.

void applyTexture(osg::Drawable* drawable, std::string imgName)
{
static std::string filePath = getenv(OSGHOME);
osg::ref_ptrosg::Image image = osgDB::readImageFile(filePath + imgName);
osg::ref_ptrosg::Texture2D tex2D = new osg::Texture2D;
tex2D-setImage(image.get());
tex2D-setResizeNonPowerOfTwoHint(false);
drawable-getOrCreateStateSet()-setTextureAttributeAndModes
(0, tex2D.get());
drawable-getOrCreateStateSet()-setMode(GL_LIGHTING,   
osg::StateAttribute::OVERRIDE |   
osg::StateAttribute::OFF);
osg::ref_ptrosg::TexEnv texEnv = new osg::TexEnv;
texEnv-setMode(osg::TexEnv::REPLACE);
drawable-getOrCreateStateSet()-setTextureAttributeAndModes
(0, texEnv.get());  
}

osg::Geode* createGeometry()
{
  float x = 0.0, y = 0.0;
  float width=0.08 , height=0.15 ;
  std::string imgName=\\images\\ring_active.png;
  osg::Geometry* boxGeom = new osg::Geometry;

boxGeom-setName(myGeometry);
osg::Vec3Array* vertices = new osg::Vec3Array;
int _z=0.0;
vertices-push_back(osg::Vec3(x,  y, _z));
vertices-push_back(osg::Vec3(x + width, y, _z));
vertices-push_back(osg::Vec3(x + width, y + height, _z));
vertices-push_back(osg::Vec3(x, y + height , _z));
boxGeom-setVertexArray(vertices);
osg::Vec3Array* normals = new osg::Vec3Array;
normals-push_back(osg::Vec3(0.0f,50.0f,1.0f));   
boxGeom-setNormalArray(normals);
boxGeom-setNormalBinding(osg::Geometry::BIND_OVERALL);
osg::Vec4Array* colors = new osg::Vec4Array;
colors-push_back(osg::Vec4(0., 0., 0., 0.9));
boxGeom-setColorArray(colors);
boxGeom-setColorBinding(osg::Geometry::BIND_OVERALL);
//applying texture
osg::ref_ptrosg::Vec2Array texCoordArray = new osg::Vec2Array;  
texCoordArray-push_back(osg::Vec2(0.f, 0.f));
texCoordArray-push_back(osg::Vec2(1.0, 0.f));
texCoordArray-push_back(osg::Vec2(1.0, 1.0));
texCoordArray-push_back(osg::Vec2(0.0, 1.0));  
boxGeom-setTexCoordArray(0, texCoordArray.get());
applyTexture(boxGeom, imgName);
boxGeom-addPrimitiveSet(new osg::DrawArrays(GL_QUADS,0,4));  
osg::StateSet* stateset = boxGeom-getOrCreateStateSet();
stateset-setMode(GL_BLEND,osg::StateAttribute::ON);  
 stateset-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
 osg::Geode* _geode=new osg::Geode;
 _geode-addDrawable(boxGeom);
 _geode-setName(myGeode);   
 geometry_center=boxGeom-getBound().center();
 return _geode;
}

 

int main( int argc, char **argv )

{
  osg::Camera* g_camera=new osg::Camera;
  g_camera-setProjectionMatrixAsOrtho2D(0,1,0,1.25);
  g_camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
  g_camera-setClearMask(GL_DEPTH_BUFFER_BIT);
  g_camera-setRenderOrder(osg::Camera::POST_RENDER);
  //rotate
  osg::ref_ptrosg::MatrixTransform rotMT=new 
osg::MatrixTransform;osg::Matrix rmatrix; 
  
rmatrix.makeRotate(osg::DegreesToRadians(45.),osg::Vec3f(0.0,0.0,1.0)); 

  rotMT-setMatrix(rmatrix);

  //translate
  osg::ref_ptrosg::MatrixTransform transMT=new 
osg::MatrixTransform;osg::Matrix tmatrix;
  tmatrix.makeTranslate(osg::Vec3f(-0.04,-0.075,0.0));
  transMT-setMatrix(tmatrix);
 
rotMT-addChild(transMT.get());
  transMT-addChild(createGeometry());
  g_camera-addChild(rotMT.get());
 

  osgViewer::Viewer viewer;
 
viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);
viewer.setCameraManipulator( new osgGA::TrackballManipulator() );   
  
viewer.addEventHandler(new Rot);
viewer.setSceneData(g_camera);

  osg::Vec3d eye(osg::Vec3f(0.0,0.0,0.0));
  osg::Vec3d center(osg::Vec3f(0.0,0.0,0.0));
  osg::Vec3d up(osg::Vec3f(0.0,0.0,0.0));

  viewer.getCameraManipulator()-setHomePosition(eye,center,up);
  viewer.home();
  viewer.realize();

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

   return 0;

}





Cheers,
Akilan

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http

Re: [osg-users] problem in camera rotation

2009-09-10 Thread Akilan Thangamani
Hi,

 I changed the order  of matrix manipulations and put everything in a single 
transformation only.
But the result I m getting is same. The geometry is going  out of view. I dont 
understand the problem. Pls anyone correct me.

Thank you!

Cheers,
Akilan

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





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


[osg-users] problem in camera rotation

2009-09-08 Thread Akilan Thangamani
Hi,

I understand that this  problem has already been discussed . But as I was not 
able
to understand clearly I post my simple camera rotation problem., I written a 
code

osg::refosg::Camera g_camera=new  osg:::camera;
g_camera-setProjectionMatrix(osg::Matrix::ortho2D(0,1,0,1));
g_camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
g_camera-setViewMatrix(osg::Matrix::Identity());
g_camera-setClearMask(GL_DEPTH_BUFFER_BIT);
g_camera-setRenderOrder(osg::camera::POST_RENDER);
g_camera-setAllowEventFocus(true);
g_camera-addChild(create_geometry()); //create_geometry() fn will return  a 
geode with //a drawable added
..
..
...
osgViewer::Viewer viewer;
viewer.setSceneData(g_camera.get());
.
while(!viewer.done())
{
if(isKey_R_pressed){

..
osg::Matrixd vmat=g_camera-getViewMatrix(); //here i get the camera thru 
traversal
vmat.makeRotate(osg::DegreesToRadians(45.),osg::osg::Vec3f(1.,0.,0.));
g_camera-setViewMatrix(vmat);

.}
viewer.frame();
}
}
I dont understand how  my geometry is not getting rotated? 
What is the problem in this?


}
}




Thank you!

Cheers,
Akilan

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





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


Re: [osg-users] problem in camera rotation

2009-09-08 Thread Akilan Thangamani
Hi,

Actually, I would like to simulate a navigation control  for north orientation 
as available in google earth. I wanted to rotate the control along the 
X-axis(+/-) that will get reflected on geocentric virtual earth. I set the 
camera to the geometry(navigation control). What I thought was  that rotating 
the camera would give the feel of geometry rotation.  Is it the correct way to 
do?  

Thank you!

Cheers,
Akilan

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





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


Re: [osg-users] Navigation control

2009-09-08 Thread Akilan Thangamani
Hi,

That s fine. But I wanted to know  about the type of GUI
component has been used for navigation. osgWidget is what I have to choose
for such design? What type of file is that??

Thank you!

Cheers,
Akilan

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





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


[osg-users] Navigation control

2009-08-20 Thread Akilan
Hi,

I would like to design a navigation control similar to the one what google earth
is using for navigating my terrain DB. I have OSG 2.2 installed. Do I need 
anything extra
to do that? osgWidget is not available in that. How  to do that?

Thank you!

Cheers,
Akilan

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





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


Re: [osg-users] Visualizing Terrain DB on web page

2009-08-18 Thread Akilan
Hi,

I updated my firefox 3.0   with the patch given in the following link,
http://3d.cineca.it/storage/OSG4Web_test/Windows/test.html . Still I couldn't 
open my osg file on firefox. Should I do anything more?


Thank you!

Cheers,
Akilan

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





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


Re: [osg-users] Visualizing Terrain DB on web page

2009-08-17 Thread Akilan
Hi,

   Yeah, I did in the same way as u said. Wrapped OSG functions into ActiveX 
control and deployed with IE. It s working fine. But it is not happening so 
with Firefox. Yes, I need help to deploy using Firefox.

Thank you!

Cheers,
Akilan

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





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


Re: [osg-users] Visualizing Terrain DB on web page

2009-08-14 Thread Akilan
Hi,

I am using Internet Explorer 6.0. 
And one more thing I have OSG2.2. Is it mandatory to have 2.9.x
version to do this.

Once the plug-in is added, could we directly see the .ive file on explorer?


Thank you!

Cheers,
Akilan

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





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


[osg-users] Visualizing Terrain DB on web page

2009-08-08 Thread Akilan
Hi,

  I would like to visualize my terrain DB constructed using osgdem on web 
page? Could it be possible? Is there any plug-in to do so?
  


Thank you!

Cheers,
Akilan

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





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


[osg-users] How to decode .ive file?

2009-07-19 Thread Akilan
Hi,


My terrain DB contains lots of .ive files(binary files). I want to decode the 
file in program to know about its children's details.  This I want to do before 
running my viewer. Is OSG provides interface for such activities?

One more query is, I have .ive file content in a buffer so that instead of 
setting the filename to readNode(), is there any interface to set the buffer 
directly to construct node in OSG?





... 

Thank you!

Cheers,
Akilan

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





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


[osg-users] Getting the name of the tile being currently loaded?

2009-06-30 Thread Akilan
Hi,

I m using OSG2.2.
I created terrain database (virtual earth) consisting tiles (.ive files) for 
8 levels. It s fact that as and when the view is changed(zoom in/out) the 
corresponding tile will be loaded dynamically(paging). Here, 
First thing is that in my code I want to capture the name of the tile/file 
being currently loaded. I run the viewer like,

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

secondly, if the corresponding tile is missing in search path, it throws 
warning message for the missed tile at console with tile name as well. I want 
to capture the same message in code. 
How could it be done??
If the osg::notify could do it, pls tell me the level of notification.
... 

Thank you!

Cheers,
Akilan

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





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


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

2009-04-29 Thread Akilan
Hi
.
I am using VPB 0.9.1 only for OSG2.2

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





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


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

2009-04-26 Thread Akilan
Hi,

While adding blumarble's .ive file as a child to a group in my application, I m 
getting the following warning and error,

Warning: Could not find plug-in to read objects from file 
C:\BlueMarble\output_L0_X0_Y0_Subtile.ive

Error reading file: DataInputStream::readUInt():Failed to read unsigned int 
value

I have installed OSG2.2(on Windows XP)  in my system and all my dlls are in 
OSG_FILE_PATH and PATH too.

What could be the problem


Thank you.

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





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


Re: [osg-users] Jerky display?

2009-04-22 Thread Akilan
Hi

I bit know about the concept of quad tree. But  I want to know applying the 
concept on OSG construction.
Can I get any reference for organizing the scenegraph in quad tree form?
Pls help me out.

Akilan A

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





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


Re: [osg-users] Jerky display?

2009-04-21 Thread Akilan
Hi

The following is the environment which i am working on,

Hardware configuration:

HP xw4400 Workstation
Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz, 2GB RAM
NVIDIA Quadro FX 3500


OS:
MS Windows XP Professional Version 2002
Service Pack 3, v.3244

OSG:
OSG2.2

The following set of code shows about how I am building scene graph for terrian 
visualization,

//the fileTerrainModels.txt Contains list of terrain models(.osga files) with 
absolute path
//all are geographic models with datum 'WGS-84' and 'UTM' projection

ifstream fin(TerrainModels.txt);   
while(!fin.eof()){
finstr;   
if(strstr(str,.osga)!=NULL){
   osg::ref_ptrosg::Fog fog=new osg::Fog;
   fog-setColor(osg::Vec4(.45,.45,.45,1.));
   fog-setStart(0.f);
   fog-setEnd(50.f);
   fog-setDensity(1.f);
   fog-setMode(osg::Fog::LINEAR);
   fog-setFogCoordinateSource(osg::Fog::FRAGMENT_DEPTH);
  
   osg::StateSet *statSet=new osg::StateSet();  

   
   statSet-setMode(GL_BLEND,osg::StateAttribute::ON);  

   statSet-setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF);


   statSet-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);   
   statSet-setAttributeAndModes(fog.get(),osg::StateAttribute::ON);

  osg::PagedLOD *plod = new osg::PagedLOD();
  plod-setName(str);  
  plod-setRangeMode(osg::PagedLOD::DISTANCE_FROM_EYE_POINT);   
   
  plod-setFileName(0, str);   
  plod-setPriorityOffset(0, 1.f); 
  plod-setPriorityScale(0, 1.f);   
   
  plod-setRange(0, 50.f, 100.f);  
  plod-setStateSet(statSet);
  group-addChild(plod);
}else if(strstr(str,bluemarble.ive)==0)  //for specifically adding 
virtual earth
group-addChild(osgDB::readNodeFile(str));
}
fin.close();

osgViewer::Viewer viewer;
osgUtil::Optimizer optimzer;

optimzer.optimize(group.get());
viewer.setSceneData(group.get());   
viewer.addEventHandler( new 
osgGA::StateSetManipulator(viewer.getCamera()-getOrCreateStateSet()) );
viewer.addEventHandler(new osgViewer::ThreadingHandler);
viewer.setCameraManipulator(new osgGA::TerrainManipulator());

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

Let me explain the problem, 
I am trying to load around 8000-9000 osg terrain models which are covering part 
of india.
As I have set the PagedLOD range 50-100, when I enter the range(zooming-down 
thru virtual earth), all the terrain models start loading and from that range 
onwards I am not able to zoom-down freely. It becomes very slow  and the view 
also jerks.

Please correct me.

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





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


Re: [osg-users] Loading of osga models dynamically?

2009-04-06 Thread Akilan
Hi

I got some idea from the previous reply and did something in my application. 
But I am not sure that the my following code is doing dynamic loading, 

//On reading each node(osga file)
osg::Node *node=osgDB::readNodeFile(argv[i]);
osg::PagedLOD *pLOD=findPLOD(node);
int child_no=pLOD-getChildIndex();
pLOD-setRange(child_no,pLOD-getMinRange(child_no),pLOD-getMaxRange(child_no));
group-addChild(node);
...
...
viewer.setSceneData(group.get());
viewer.run();

If ur answer is redundant, pls execuse and get me cleared.

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





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


[osg-users] [osgPlugins] Warning : Could not find plug-in for reading objects from file .osga?

2009-04-06 Thread Akilan
Hi,

I am using osg2.2(from binary executable) on visual studio 2005. 
My application loads (readNodeFile) osga files from specified folder.
It happens properly when the folder contains less number of osga files. 
When the number of files exceed certain number (say some 500 or more), it 
throws  Warning : Could not find plug-in for reading objects from file 
xyz.osga and readNodeFile fails.

I saw  the post for similar kind of problem while reading png /jpeg files.
Let me know what needs to be done for osga file reading error?
... 

Thank you.

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





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


[osg-users] Performing zooming and other navigations on geocentric virtual earch?

2009-03-24 Thread akilan
Hi,

I have created geocentric(spherical) virtual earth and wanted to do navigate 
around the earth using keyboard including zooming-in and out.  As I m new  to 
OSG I want to understand dat could it be done by setting viewmatrixAsLookAt of  
views' cameramanipulator? Plz get me some ideas how it can be done???
... 

Thank you.

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





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