Re: [osg-users] OSG 3.4 and Qt 5 cmake problem. Found unsuitable Qt version

2017-04-10 Thread Elias Tarasov
Yes, dummy me. I just setup CMAKE_PREFIX_PATH to the wrong directory. Now 
everything is ok. 


Thank you!

Cheers,
Elias

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





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


[osg-users] OSG 3.4 and Qt 5 cmake problem. Found unsuitable Qt version

2017-04-10 Thread Elias Tarasov
Hi!

I try to compile OSG 3.4 with Qt 5.5.1 on Ubuntu 16.04 LTS by using CMake tool.

The problem i've faced is CMake error message: 
"Found unsuitable Qt version "5.5.1" from /opt/Qt/5.5/gcc_64/bin/qmake"

I found some hints like this: 
https://qt.developpez.com/doc/5.0-snapshot/cmake-manual/
where it is said how to setup CMake to allow it to find and use Qt 5. 
However, is there more easy way to accomplish this?

I was unable to find the clean and the direct answer.

Thank you!

Cheers,
Elias

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





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


Re: [osg-users] Joystick support in OSG

2015-11-06 Thread Elias Tarasov
Hello!

To solve abovementioned task i searched for examples into OSG's projects: 
present3D app, osgviewerSDL example and sdl plugin.
Also, i looked into these docs: 
https://www.libsdl.org/release/SDL-1.2.15/docs/html/guideinput.html

Eventually i came up with that code: 
https://drive.google.com/file/d/0ByDDImhSolf6MDYzMllhd0xFTkE/view?usp=sharing

My joystick is successfully recognized by SDL.
Numbers of buttons, axes, and hats are returned correctly.

However, expression 

Code:
auto ifEventExists = SDL_PollEvent();

 
always returns zero, which means not a single one input event exists.

So i've never been able to pass into 

Code:
switch (jevent.type) { 

}




section.

Could anybody being familiar with SDL help with that issue?

Thank you!

Cheers,
Elias

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





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


Re: [osg-users] Joystick support in OSG

2015-11-02 Thread Elias Tarasov
Hi!
Thanks for replies!
Eventually, i built OSG 3.2.0 with SDL 1.2 support. 
Test app works, however, i'm still trying to figure out how exactly combine 
sdl-handling joystick's input and OSG. 

SDL 2.0 doesn't build under MSVC 2015. Not to mention building it as OSG 
plugin. 
The errors are known, but as i was able to find out, it happens due to the 
incorrect VCRT's supporting under MSVC 2015.

Thanks a lot for help!

Cheers,
Elias

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





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


[osg-users] Joystick support in OSG

2015-11-02 Thread Elias Tarasov
Hi!

Which is the best way of supporting joystick's input in modern OSG? 
OSG Cookbook says it's a Directinput 3rdParty lib, but looking into OSG trunk 
code it seems that last update was done 5 years ago. SDL was updated 5 month 
ago, but that comment in the last commit


> 
> OpenSceneGraph\src\osgPlugins\sdl\JoystickDevice.cpp(42): error C2664: 'const 
> char *SDL_JoystickName(SDL_Joystick *)' : cannot convert argument 1 from 
> 'int' to 'SDL_Joystick *'
> due to changes in the SDL api.
> 
> Tested with Visual Studio Express 2013; SDL 2.0.1"
> 


makes me uncertain about that choice.

Could anybody please provide more consistent info?

Thanks a lot and best regards!

Cheers,
Elias

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





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


Re: [osg-users] Rotation of a node starts clockwise and ends counter-clockwise.

2015-10-30 Thread Elias Tarasov
Hello, Sebastian!
First of all, i apologise for the very long time delay in the response. 
Somehow i didn't noticed that there was an answer to my question, and thought 
that nobody was interested.
Yesterday i found your last message in that thread and tried your suggestions, 
and they had worked.

Here is video, DOFTransform's rotation:
https://drive.google.com/file/d/0ByDDImhSolf6Q25SVFpyTzNLSFU/view?usp=sharing
On a video you can see that sampling artifact/aliasing which you mentioned 
earlier.
However, even with the highest possible roll and having seen the scene just on 
the screen, the continious rotation can never be achieved.
It can be very fast, but not as smooth as it should be.

Compare to this (FlightGear is based on OSG):
https://drive.google.com/file/d/0ByDDImhSolf6YWtPbVRfb0ExQlU/view?usp=sharing

My assumption here that it couldn't be done just via rotation, instead of the 
rotating propeller some other "blur" object must be drawn and then placed on 
the propeller's position.

Is that correct? 

Thank you!

Cheers,
Elia

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





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


[osg-users] Rotation of a node starts clockwise and ends counter-clockwise.

2015-08-12 Thread Elias Tarasov
Hi!

My node which i want to rotate is a propeller, and let say it should rotate 60 
times per second (60 rps).
My notebook's screen has 60Hz and i have read somewhere that this leads to call 
NodeCallback::operator() 60 times per second
(for optimization reason, but it's only my assumption).
Let also say that deltaAngle is an angle i want to rotate my propeller for each 
time operator() is called (60 Hz - 60 times per second in my case).
Then for needed 60 rps i have:
Code:

deltaAngle = 2.0 * osg::Pi / (60 * 60) 


rad, is that correct?
If it is, then my callback operator is:

Code:

class UpdateCallback : public NodeCallback {
public:
UpdateCallback() : angle(0.0), deltaAngle(2.0f * osg::PI / 3600.0f),  
rotation() {}
virtual void operator () (Node* node, NodeVisitor* nv) {
MatrixTransform* mt = dynamic_castMatrixTransform*( 
node );
if ( mt != NULL ) {
if(angle  2.0f * osg::PI)
angle += deltaAngle;
else
angle = 0.0;
rotation.makeRotate(angle, Y_AXIS);
Matrix rotate(rotation);
Matrix translate = mt-getMatrix();
Matrix setupTransAndRot = rotate * translate;
mt-setMatrix(setupTransAndRot);
  }
  traverse(node,nv);
}
private:
double angle;
  const double deltaAngle;
  Quat rotation;
};



The video of running program 
https://drive.google.com/file/d/0ByDDImhSolf6SS1fREJZTG1aNDA/view?usp=sharing
displays 2 issues:
1. Somehow rotation is not linear, but instead has acceleration.
2. It starts clockwise, but ends counter-clockwise.

Thank you!

Cheers,
Elias

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





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


Re: [osg-users] Rotation of a node starts clockwise and ends counter-clockwise.

2015-08-12 Thread Elias Tarasov
Hi, Sebastian!
Thanks for help and quick answer.
I've tested your suggestion, but failed.
The problem i have now is that after i replaced MatrixTransform by 
DOFTransform, i lost all my engines, that i previously attached to main frame 
by using MatrixTransform
The code (try to attach only one engine to main osg::Group frame for short)

Code:

ref_ptrDOFTransform transform = new DOFTransform;
transform-addChild( nodeEngineCCW.get() );
transform-setCurrentTranslate( Vec3(0.0, 0.0, 0.0) );
groupAircraft-addChild( transform.get() );




It is expected that the engine must be right in the center of the model (as it 
was happend with the MatrixTransform), but it is not.

Fucntion member setCurrentTranslate seems the most suitable candidate to move 
child nodes. 
I was not able to find any significant example of using it neither in examples, 
supplied by OSG, nor in google. Doxygen docs on this class tell almost nothing. 
 
For instance, maybe setCurrentTranslate argument doesn't have a meaning of a 
vector with respect to a parent?
Could you provide an example ( link, or something) ?

Thank you for your help and patience!

Cheers,
Elias

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





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


Re: [osg-users] NodeVisitor finds the named Node, but NodeCallback doesn't rotate it

2015-08-10 Thread Elias Tarasov
Solved. 
Yes, truly the transformation matix was not attached to the scene graph, that 
caused problem, described above.

Also, i used osg::AnimationPath and no NodeCallback is required here.

Thank you!

Cheers,
Elias

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





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


Re: [osg-users] NodeVisitor finds the named Node, but NodeCallback doesn't rotate it

2015-08-03 Thread Elias Tarasov
Hi, scrawl!

Im not sure that i understand what do you mean by saying detached graph.

I have now:
Root-Group-MatrixTransform-Node.

//Here is Node
ref_ptrNode nodeEngineCW = osgDB::readNodeFile(pathToACModels + 
engineCW.ac);

//Here is MatrixTransform
ref_ptrMatrixTransform setupForwardEngine = new MatrixTransform;
setupForwardEngine-addChild( nodeEngineCW.get() );

//Here is Group
ref_ptrGroup groupAircraft =new Group;
groupAircraft-addChild( setupForwardEngine.get() );

//Here is Root
ref_ptrGroup rootnode = new Group;
rootnode-addChild( groupAircraft.get() );

Everything seems fine in this sense.

Thank you!

Cheers,
Elias

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





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


[osg-users] NodeVisitor finds the named Node, but NodeCallback doesn't rotate it

2015-08-01 Thread Elias Tarasov
Hi!
I have .ac models. One is a quadrocopter and two others are it's engines. Each 
engine has propeller, which i want to animate by rotation. To do it, i have to 
find propeler's node for the start. What i was able to find that two ways are 
exist.
First is to find a node by it's name.
Second is to find a node by it's unique characteristics.
Here is models: 
https://drive.google.com/file/d/0ByDDImhSolf6cnVIN3JIMzJQTGs/view?usp=sharing

So the 1st question: 
How to determine, the name of the node or it's other characteristics, to be 
able to find it?

I developed simple program that searches a node by it's name. Something, that 
looks like a node's name i found when open .ac file using notepad and search 
for the name tag. But im not sure.

Here is code: 
https://drive.google.com/file/d/0ByDDImhSolf6U3BmTXpjeE1mRDg/view?usp=sharing
The problem: NodeVisitor finds a node( though im not sure this node is a 
propeller), but NodeCallback doesn't rotate it.

So the 2nd question: Why the element, identified by it's name, does not rotate?

The reason, why im sure that these models should be able to rotate anyway, is 
that i took them from another app, based on OSG and it works well.

Thank you!

Cheers,
Elias

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





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


Re: [osg-users] OpenGL Shader Compile Problem: repeated #version directive

2015-07-20 Thread Elias Tarasov
That would be great if you contact osgHimmel authors :) 
Meanwhile of course i try to fix it by myself.

... 

Thank you!

Cheers,
Elias

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





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


Re: [osg-users] OpenGL Shader Compile Problem: repeated #version directive

2015-07-20 Thread Elias Tarasov
Fixed!  :) 
The solution (in that particular case) is straightforward.
The code:

Code:

const std::string glsl_version_150()
{
static const std::string source(PRAGMA_ONCE(version,#version 150 
compatibility\n\n));
return source;
};




must be replaced by:


Code:

const std::string glsl_version_150()
{
static const std::string source(#version 150 compatibility\n\n);
return source;
};




Thank you for help and great patience!

Cheers,
Elias

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





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


Re: [osg-users] OpenGL Shader Compile Problem: repeated #version directive

2015-07-19 Thread Elias Tarasov
Hi!

1.

 
 
  
  /snip
  0(5) : error C0204: version directive must be first statement and may not 
  be repeated 
  
 
 Where is this line of code? Inside your code?
 


No, that line is in osgHimmel code.

2.

 
 Have you tried to comment out the line above? 
 


Yes, and in this case the error is:

Atmopshere Precomputed (took 7.45826 s)
Warning, can't assign attribute binding as no has been array assigned to set 
binding for.
PNG lib warning : iCCP: known incorrect sRGB profile
PNG lib warning : iCCP: known incorrect sRGB profile
VERTEX glCompileShader  FAILED
VERTEX Shader  infolog:
0(27) : error C5060: out can't be used with non-varying m_eye
0(28) : error C5060: out can't be used with non-varying m_ray

glLinkProgram  FAILED
Program  infolog:
Vertex info
---
0(27) : error C5060: out can't be used with non-varying m_eye
0(28) : error C5060: out can't be used with non-varying m_ray

Fragment info
-
0(106) : warning C7011: implicit cast from int to float
0(106) : warning C7011: implicit cast from int to float

VERTEX glCompileShader  FAILED
VERTEX Shader  infolog:
0(90) : error C5060: out can't be used with non-varying v_k
0(91) : error C5060: out can't be used with non-varying v_color
0(98) : warning C7011: implicit cast from int to float
0(113) : warning C7011: implicit cast from int to float
0(113) : warning C7011: implicit cast from int to float
0(119) : warning C7011: implicit cast from int to float
0(124) : warning C7548: '^' requires #extension GL_EXT_gpu_shader4 : enable 
before use
0(124) : warning C7011: implicit cast from int to float
0(124) : warning C7011: implicit cast from int to float
0(125) : warning C7532: global function texture requires #version 130 or later

GEOMETRY glCompileShader  FAILED
GEOMETRY Shader  infolog:
0(46) : error C: syntax error, unexpected '(', expecting :: at token (
0(54) : error C5060: out can't be used with non-varying g_color
0(58) : warning C7011: implicit cast from int to float
0(63) : warning C7532: global variable gl_in requires #version 150 or later
0(63) : warning C7532: global variable gl_Position requires #version 150 or 
later

glLinkProgram  FAILED
Program  infolog:
Vertex info
---
0(90) : error C5060: out can't be used with non-varying v_k
0(91) : error C5060: out can't be used with non-varying v_color
0(98) : warning C7011: implicit cast from int to float
0(113) : warning C7011: implicit cast from int to float
0(113) : warning C7011: implicit cast from int to float
0(119) : warning C7011: implicit cast from int to float
0(124) : warning C7548: '^' requires #extension GL_EXT_gpu_shader4 : enable 
before use
0(124) : warning C7011: implicit cast from int to float
0(124) : warning C7011: implicit cast from int to float
0(125) : warning C7532: global function texture requires #version 130 or later

Geometry info
-
0(46) : error C: syntax error, unexpected '(', expecting :: at token (
0(54) : error C5060: out can't be used with non-varying g_color
0(58) : warning C7011: implicit cast from int to float
0(63) : warning C7532: global variable gl_in requires #version 150 or later
0(63) : warning C7532: global variable gl_Position requires #version 150 or 
later

Fragment info
-
0(18) : warning C7011: implicit cast from int to float
0(20) : warning C7011: implicit cast from int to float
0(27) : warning C7011: implicit cast from int to float
0(28) : warning C7011: implicit cast from int to float

VERTEX glCompileShader  FAILED
VERTEX Shader  infolog:
0(8) : error C5060: out can't be used with non-varying m_tangent
0(9) : error C5060: out can't be used with non-varying m_eye

glLinkProgram  FAILED
Program  infolog:
Vertex info
---
0(8) : error C5060: out can't be used with non-varying m_tangent
0(9) : error C5060: out can't be used with non-varying m_eye

Fragment info
-
0(114) : warning C7011: implicit cast from int to float
0(118) : warning C7011: implicit cast from int to float
0(120) : warning C7011: implicit cast from int to float
0(120) : warning C7011: implicit cast from int to float
0(120) : warning C7011: implicit cast from int to float
0(120) : warning C7011: implicit cast from int to float
0(120) : warning C7011: implicit cast from int to float
0(122) : warning C7011: implicit cast from int to float
0(123) : warning C7011: implicit cast from int to float
0(123) : warning C7011: implicit cast from int to float
0(127) : warning C7011: implicit cast from int to float
0(129) : warning C7011: implicit cast from int to float
0(135) : warning C7011: implicit cast from int to float
0(144) : warning C7011: implicit cast from int to float
0(171) : warning C7011: implicit cast from int to float
0(171) : warning C7011: implicit cast from int to float
0(171) : warning C7011: implicit cast from int to float
0(171) : warning C7011: implicit cast from int to float
0(187) : warning C7011: implicit cast from int to float
0(187) : warning C7011: implicit cast from int to float
0(198) : 

[osg-users] OpenGL Shader Compile Problem: repeated #version directive

2015-07-18 Thread Elias Tarasov
Hello!

GPU: nVidia 540M
Driver: 353.30
OpenGL version: 4.3.
OS Windows 7

I intend to use osgHimmel library in my project.
However, when i run the app, i get the shader's compile error:

Atmopshere Precomputed (took 7.95881 s)
Warning, can't assign attribute binding as no has been array assigned to set 
binding
PNG lib warning : iCCP: known incorrect sRGB profile
PNG lib warning : iCCP: known incorrect sRGB profile
VERTEX glCompileShader  FAILED
VERTEX Shader  infolog:
0(5) : error C0204: version directive must be first statement and may not be 
repeated

FRAGMENT glCompileShader  FAILED
FRAGMENT Shader  infolog:
0(5) : error C0204: version directive must be first statement and may not be 
repeated

glLinkProgram  FAILED
Program  infolog:
Vertex info
---
0(5) : error C0204: version directive must be first statement and may not be 
repeated

Fragment info
-
0(5) : error C0204: version directive must be first statement and may not be 
repeated

VERTEX glCompileShader  FAILED
VERTEX Shader  infolog:
0(5) : error C0204: version directive must be first statement and may not be 
repeated

GEOMETRY glCompileShader  FAILED
GEOMETRY Shader  infolog:
0(5) : error C0204: version directive must be first statement and may not be 
repeated

FRAGMENT glCompileShader  FAILED
FRAGMENT Shader  infolog:
0(5) : error C0204: version directive must be first statement and may not be 
repeated

glLinkProgram  FAILED
Program  infolog:
Vertex info
---
0(5) : error C0204: version directive must be first statement and may not be 
repeated

Geometry info
-
0(5) : error C0204: version directive must be first statement and may not be 
repeated

Fragment info
-
0(5) : error C0204: version directive must be first statement and may not be 
repeated

VERTEX glCompileShader  FAILED
VERTEX Shader  infolog:
0(5) : error C0204: version directive must be first statement and may not be 
repeated

FRAGMENT glCompileShader  FAILED
FRAGMENT Shader  infolog:
0(5) : error C0204: version directive must be first statement and may not be 
repeated

glLinkProgram  FAILED
Program  infolog:
Vertex info
---
0(5) : error C0204: version directive must be first statement and may not be 
repeated

Fragment info
-
0(5) : error C0204: version directive must be first statement and may not be 
repeated

VERTEX glCompileShader  FAILED
VERTEX Shader  infolog:
0(5) : error C0204: version directive must be first statement and may not be 
repeated

FRAGMENT glCompileShader  FAILED
FRAGMENT Shader  infolog:
0(5) : error C0204: version directive must be first statement and may not be 
repeated

glLinkProgram  FAILED
Program  infolog:
Vertex info
---
0(5) : error C0204: version directive must be first statement and may not be 
repeated

Fragment info
-
0(5) : error C0204: version directive must be first statement and may not be 
repeated

Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)
Warning: detected OpenGL error 'invalid value' at after RenderBin::draw(..)

I have several objects, each of which uses Vertex, Fragment, and Geometry 
shaders.
With a help of community's members here, i found the place where the error 
might be:

const std::string glsl_version_150()
{
static const std::string source(PRAGMA_ONCE(version,#version 150 
compatibility\n\n));
return source;
};

This function is called every time to create any shader. And therefore #version 
directive is realy called multiple times.
According to OpenGL SL #version must be the first line and cannot be repeated.
However, this definition is unclear: Is #version must be the one and only one 
for the entire host OpenGL program? For the host object that uses shader? Or 
for every single main() entry of the shader?

Can anybody pointed out how to solve that issue?

Thank you!

Cheers,
Elias

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





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


Re: [osg-users] Atmospheric effects in OSG

2015-07-16 Thread Elias Tarasov
Hello!
I chose to follow the advice and try to use osgHimmel. However, i've got the 
problem: when i launch any osgHimmel-based app (examples or mine), i've got 
nothing on the screen except:

Atmopshere Precomputed (took 11.2606 s)
VERTEX glCompileShader  FAILED
VERTEX Shader  infolog:
0(5) : error C0204: version directive must be first statement and may not be 
repeated

FRAGMENT glCompileShader  FAILED
FRAGMENT Shader  infolog:
0(5) : error C0204: version directive must be first statement and may not be 
repeated

glLinkProgram  FAILED
Program  infolog:
Vertex info
---
0(5) : error C0204: version directive must be first statement and may not be 
repeated

Fragment info
-
0(5) : error C0204: version directive must be first statement and may not be 
repeated

VERTEX glCompileShader  FAILED
VERTEX Shader  infolog:
0(5) : error C0204: version directive must be first statement and may not be 
repeated

GEOMETRY glCompileShader  FAILED
GEOMETRY Shader  infolog:
0(5) : error C0204: version directive must be first statement and may not be 
repeated

FRAGMENT glCompileShader  FAILED
FRAGMENT Shader  infolog:
0(5) : error C0204: version directive must be first statement and may not be 
repeated

On the wiki i didn't find any info about that problem except one unanswered 
comment about that.

It seems that something wrong with a shaders. Can anybody pointed why?

Thank you!

Cheers,
Elias

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





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


Re: [osg-users] Atmospheric effects in OSG

2015-07-16 Thread Elias Tarasov
My GPU is NVIDIA® GeForce® GT 520M, DirectX 11. Integrated laptop graphic card.

Cheers,
Elias

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





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


Re: [osg-users] Atmospheric effects in OSG

2015-07-16 Thread Elias Tarasov
That's great, i will try your suggestions as soon as i can be near my laptop. 
:D 
Hope it helps, thanks for the quick reply!

Cheers,
Elias

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





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


Re: [osg-users] Atmospheric effects in OSG

2015-07-16 Thread Elias Tarasov
Updated:

Fixed error in osgEphemeris, trying to build an app and see what's what.

Cheers,
Elias

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





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


Re: [osg-users] Atmospheric effects in OSG

2015-07-16 Thread Elias Tarasov
Christian, unfortunately the result is the same.
I did:
1. Updated my nvidia driver to the newest one.
2. Intel Update Utility says that my Intel Graphics driver is up-to-date.

BTW i bought this laptop about one year ago, while the last update of osgHimmel 
was about 2 years ago...so i pretty much sure that outdated opengl is not the 
case.

Also, i tried to compile osgEphemeris, just to test. However, one error stopped 
me:

 osg::Drawable *dbl = geode-getDrawable(i);
 osg::Drawable::UpdateCallback *updateCallback = dbl-getUpdateCallback();

Error   1   error C2440: 'initializing' : cannot convert from 
'osg::Callback *' to 'osg::Drawable::UpdateCallback *'
C:\osgEphemeris\src\osgEphemerisLib\SkyDome.cpp 71  1   osgEphemeris

Do you have any ideas?
My OSG version is 3.3.8.
Maybe some inconsistency between OSG and osgHimmel do exist? 
Can i test my OpenGL capabilities to draw the shaders?

Cheers,
Elias

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





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


[osg-users] Atmospheric effects in OSG

2015-07-07 Thread Elias Tarasov
Hello!
Excuse me for the perhaps dumb question, but could anybody points on an example 
of creating clouds, sky, light and other atmoshperic effects?

I found osgVisual, but the project seems to be outdated.

Can't find the proper solution.

Thank you!

Cheers,
Elias

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





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


Re: [osg-users] How to rotate node's local coordinate system?

2015-06-24 Thread Elias Tarasov
Hi, Sebastian!
Your suggestion works, i get now properly oriented cessna.
However, my eye vector is oriented not as i expected. 
So i can't say that i was able to properly figure out what happens with my node 
and camera.
Anyway, it's a one step closer now.

Thank you!

Cheers,
Elias

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





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


Re: [osg-users] How to rotate node's local coordinate system?

2015-06-23 Thread Elias Tarasov
Hello, Robert!
Thanks for the quick reply.
It seems i wasn't able to clarify my question. I dont use MatrixTransform or 
PositionAttitudeTransform here because i don't want to transform my target node 
relate to others. I want to change local XYZ in that node itself, not the 
position of my node relate to other nodes or world XYZ.

Let me describe more specifically. 
Standart aerodynamic convention (and it also looks reasonable in most practical 
situations) defines local(body) coordinate system as:
O - center of mass (here just center of a node), X - from center up to nose, Y 
- from center up to right wing, Z - down. That leads to Roll, Pitch, Yaw 
rotations around X,Y,Z respectively.

Let say i want to place camera right behind cessna's tail. Then, AFAIK that 
code can help me

Code:

nodeTracker = new osgGA::NodeTrackerManipulator;
nodeTracker-setHomePosition( Vec3(-90,0,0), Vec3(), Z_AXIS );
nodeTracker-setTrackerMode(osgGA::NodeTrackerManipulator::NODE_CENTER_AND_ROTATION
 );
nodeTracker-setTrackNode( cessna.get() );




So: eye Vec3(-90,0,0) means 90 behind center on X. //Local coords, right?
And of course what we can see now is depended on how X is oriented with respect 
to model body.

If, for instance, X has center at model's center and go straight up to nose,
then -90 means right behind tail (this is what i want to achieve)

But if X has center at model's center and go from right wing, then -90 means we 
see left side of an aeroplane, not the tail.

Then, even when cessna moves correctly (for instance, straight to the north), i 
see at as moving with right wing forward and nose to the west.

Also, Roll (rotation about X axis) will be looking like pitch (rotation about Y 
axis according to aerodynamic standart)
So to avoid confusion and necessity to remeber how that particular node 
(cessna) is oriented with respect to its own local coords, maybe the better
way is to rotate local coords somehow?

I might be wrong, just to explain why i cannot use Tranform classes according 
to you advice.

Could you explain how that problem might be solved?

Thank you!

Cheers,
Elias

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





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


[osg-users] How to rotate node's local coordinate system?

2015-06-22 Thread Elias Tarasov
Hello!
I'm sorry for noob question, but i cannot figure out how to rotate node's local 
coordinate system.

For my task i use default OSG cessna model. According to my experiments, it has 
axes: X - from center to left wing. Y - from center down tail. Z - down.

What i want is to rotate axes: X - from center to nose. Y - from center to 
right wing. Z - down. 

I think i have skills to define rotation matrix, but i don't know the way to 
rotate osg::Node and save that rotated osg::Node. 

Basically something like that:

Code:

osg::ref_ptrosg::Node cessna = osgDB::readNodeFile(...)
//Here should be the rotation func
osg::ref_ptrosg::Node rotated_cessna = rotateLocalXYZ(cessna.get())

nodeTracker = new osgGA::NodeTrackerManipulator;

//now here i can setup eye and up vectors more consistently
nodeTracker-setHomePosition( Vec3(0,270,0), Vec3(), Z_AXIS );

nodeTracker-setTrackerMode( 
osgGA::NodeTrackerManipulator::NODE_CENTER_AND_ROTATION );
nodeTracker-setTrackNode( rotated_cessna.get() );



Can anybody provided an example how to do it?

Thank you!

Cheers,
Elias

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





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


Re: [osg-users] [vpb] geographic to geocentric coordinate transformation

2015-06-20 Thread Elias Tarasov
Hello, Christian!
Yes, it helped me very much!
The code you posted works, and i also managed to add external FDM engine to 
calculate and getting data for cessna. Also, i added camera that moved behind 
cessna and now get a nice view of moving aeroplane, which position and 
orientation are defined by external physic engine and attached to geocentric 
coordinates.

Though i still have a problems of how to define the up vector (it seems like 
eye and center are with respect to ECEF, but the up is somehow with respect to 
my screen? ). 

But anyway, now thanks to you help i have a room for experiments.

Thank you!

Cheers,
Elias

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





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


Re: [osg-users] [vpb] geographic to geocentric coordinate transformation

2015-06-18 Thread Elias Tarasov
Hello, Christian!

Again, your comments helped me:)
And again, i can't understand it from the first time.

The root of the problem here is how to move and rotate camera.
And the root of it is how to calculate needed matrices.

So, i looked for it:

1. Looked into general OSG forum.
2. Looked into vpb forum.
3. Stackoverflow.

There are a lot of info but to indicate what kind of problem i have, here is 
the pattern of what i found:

Vec3d eye( 1000.0, 1000.0, 0.0 );
Vec3d center( 0.0, 0.0, 0.0 );
Vec3d up( 0.0, 0.0, 1.0 );
viewer.getCamera()-setViewMatrixAsLookAt( eye, center, up );

Assumption: 
Vectors must be defined with respect to some choosen coordinate frame. 
So, with respect to what frame eye, center, up are defined? 
How can i calculate them?
I presume, that without knowing in what frame vectors are expressed, and how to 
move to that frame from already defined frame (for instance from ECEF), 
variables like Vec3d eye( 1000.0, 1000.0, 0.0 ) are useless. 

Here is the code i changed according to your recomendations.
In the comments, there are at least three issues:
1. How to correctly define rotation?
2. How to define Up vector.
3. How to correctly add moved camera.

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

osg::ref_ptrosg::Group root = new osg::Group;
osg::ref_ptrosg::Node cessna = 
osgDB::readNodeFile(c:/OpenSceneGraph/data/cessnafire.osg);
osg::ref_ptrosg::Node map = 
osgDB::readNodeFile(c:/Terrain/FromUSGS/output/out.osgb);
osg::ref_ptrosg::Camera camera = new osg::Camera;

//Getting XYZ position for cessna
//-85.4877762 is terrain's center lat
//30.5292506 is terrain's center lon
//100 m - height above terrain we want to place the cessna.
osg::Matrix cessnaLocation;
osg::EllipsoidModel ellipsoid;

ellipsoid.computeLocalToWorldTransformFromLatLongHeight(osg::DegreesToRadians(-85.4877762),
 osg::DegreesToRadians(30.5292506), 100, cessnaLocation);
osg::Vec3 positionForCessna = cessnaLocation.getTrans(); 

//Placing cessna
osg::ref_ptrosg::PositionAttitudeTransform moveCessna = new 
osg::PositionAttitudeTransform;
moveCessna-setPosition(positionForCessna);
moveCessna-addChild(cessna.get());

//Getting XYZ position for camera
//Lat Lon are the same, height is 150
osg::Matrix cameraLocation;

ellipsoid.computeLocalToWorldTransformFromLatLongHeight(osg::DegreesToRadians(-85.4877762),
 osg::DegreesToRadians(30.5292506), 150, cameraLocation);
osg::Vec3 positionForCamera = cameraLocation.getTrans(); 

//Placing camera
osg::ref_ptrosg::PositionAttitudeTransform moveCamera = new 
osg::PositionAttitudeTransform;
moveCamera-setPosition(positionForCamera);
moveCamera-addChild(camera.get());

//rotation and Y up
//How to setup rotation matrix? with respect to what coordinate frame? 
I presume View frame with respect to ECEF?
osg::Matrix rotation;
rotation.makeRotate(osg::PI_2, osg::Vec3f(1.0, 0.0, 0.0)); //Here we 
rotate around X on the angle pi/2. But rotate around what?

//How to define that matrix and why does it need?
osg::Matrix ToYUP;  //Maybe here we can define a direction around of 
which we make our rotation?

//View = translation * YUP * rotation;
osg::Matrix viewMatrix;
viewMatrix = cameraLocation * ToYUP * rotation;
camera-setViewMatrix(viewMatrix);
 
//How to add moved camera?
root-addChild(camera.get() );
//Or maybe even camera-addChild( root.get() ); ?
root-addChild( moveCessna.get() );
root-addChild( map.get() );

osg::ref_ptrosgViewer::Viewer viewer = new osgViewer::Viewer;
viewer-setCamera( camera.get() );
viewer-setSceneData( root.get() );

return viewer-run();
}


Thank you!

Cheers,
Elias

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





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


Re: [osg-users] [vpb] geographic to geocentric coordinate transformation

2015-06-17 Thread Elias Tarasov
Hello!
It seems i have a problem Deniz had faced previously.
My generated terrain viewed from osgviewer is here:
https://drive.google.com/file/d/0ByDDImhSolf6Szh5YW81MDdqV2M/view?usp=sharing

My gdalinfo for dem file used to generate terrain is here:

Driver: GTiff/GeoTIFF
Files: n30_w086_1arc_v3_conv.tif
   n30_w086_1arc_v3_conv.tif.aux.xml
Size is 58, 50
Coordinate System is:
GEOGCS[WGS 84,
DATUM[WGS_1984,
SPHEROID[WGS 84,6378137,298.257223563,
AUTHORITY[EPSG,7030]],
AUTHORITY[EPSG,6326]],
PRIMEM[Greenwich,0],
UNIT[degree,0.0174532925199433],
AUTHORITY[EPSG,4326]]
Origin = (-85.4959721,30.5362503)
Pixel Size = (0.0002778,-0.0002778)
Metadata:
  AREA_OR_POINT=Point
  DTED_CompilationDate=0002
  DTED_DataEdition=02
  DTED_DigitizingSystem=SRTM
  DTED_HorizontalAccuracy=0013
  DTED_HorizontalDatum=WGS84
  DTED_MaintenanceDate=
  DTED_MaintenanceDescription=
  DTED_MatchMergeDate=
  DTED_MatchMergeVersion=A
  DTED_NimaDesignator=DTED2
  DTED_OriginLatitude=030N
  DTED_OriginLongitude=086W
  DTED_Producer=USCNIMA
  DTED_RelHorizontalAccuracy=NA
  DTED_RelVerticalAccuracy=0004
  DTED_SecurityCode_DSI=U
  DTED_SecurityCode_UHL=U
  DTED_UniqueRef_DSI=H24 084
  DTED_UniqueRef_UHL=H24 084
  DTED_VerticalAccuracy_ACC=0005
  DTED_VerticalAccuracy_UHL=0005
  DTED_VerticalDatum=E96
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( -85.4959722,  30.5362500) ( 85d29'45.50W, 30d32'10.50N)
Lower Left  ( -85.4959722,  30.5223611) ( 85d29'45.50W, 30d31'20.50N)
Upper Right ( -85.4798611,  30.5362500) ( 85d28'47.50W, 30d32'10.50N)
Lower Right ( -85.4798611,  30.5223611) ( 85d28'47.50W, 30d31'20.50N)
Center  ( -85.4879167,  30.5293056) ( 85d29'16.50W, 30d31'45.50N)
Band 1 Block=58x50 Type=Int16, ColorInterp=Gray
  Min=31.000 Max=61.000
  Minimum=31.000, Maximum=61.000, Mean=49.202, StdDev=6.253
  NoData Value=0
  Unit Type: m
  Metadata:
STATISTICS_MAXIMUM=61
STATISTICS_MEAN=49.202413793103
STATISTICS_MINIMUM=31
STATISTICS_STDDEV=6.2528388891449

Here, center of my terrain is: 
Center  ( -85.4879167,  30.5293056) ( 85d29'16.50W, 30d31'45.50N)

Now i want to place a camera in the center of that terrain to use it from an 
app:

const double M_PI_2 = 1.57079632679489661923; 

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

osg::ref_ptrosg::Group root = new osg::Group;
osg::ref_ptrosg::Node cessna = 
osgDB::readNodeFile(c:/OpenSceneGraph/data/cessnafire.osg);
osg::ref_ptrosg::Node map = 
osgDB::readNodeFile(c:/Terrain/FromUSGS/output/out.osgb);
root-addChild( cessna.get() );
root-addChild( map.get() );

osg::ref_ptrosgViewer::Viewer viewer = new osgViewer::Viewer;
viewer-setSceneData( root.get() );

osg::Matrixd vm;
osg::EllipsoidModel ellipsoid;

ellipsoid.computeLocalToWorldTransformFromLatLongHeight(osg::DegreesToRadians(-85.4877762),
 osg::DegreesToRadians(30.5292506), 100, vm);
vm.invert(vm);

osg::Matrixd rotation2YUp;
rotation2YUp.makeRotate(-M_PI_2, osg::Vec3f(1.0, 0.0, 0.0));
vm *= rotation2YUp;
viewer-getCamera()-setViewMatrix(vm); 

return viewer-run();
}

But i don't see anything. Just empty screen. 
Well, since terrain had been built in geocentric mode, i think app somehow 
moved terrain and cessna to the correct position in ECEF. 
So, i just need to move a camera to that position.

I guess camera's position is wrong, but i don't know how to fix it.

Thank you!

Cheers,
Elias

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





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


Re: [osg-users] [vpb] Correct way to get texture data from USGS or any other source?

2015-06-14 Thread Elias Tarasov
Hi!
Finally, when i croped extra data from the source dem file (i used QGis), then 
translation works fine and i get needed terrain.

Thank you!

Cheers,
Elias

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





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


Re: [osg-users] [vpb] Correct way to get texture data from USGS or any other source?

2015-06-11 Thread Elias Tarasov
Hello!

My statement about the problem, that had been solved, looks a little premature.

The problem: 
Terrain is displayed incorrectly.
Results:
1. https://drive.google.com/file/d/0ByDDImhSolf6cGFyV21PRXZuZHM/view?usp=sharing
2. https://drive.google.com/file/d/0ByDDImhSolf6N3FvRkNJUW1nMlk/view?usp=sharing

Step-by-step actions to make a terrain

0. Gathering required data
0.1. Choose texture:

https://drive.google.com/file/d/0ByDDImhSolf6S3E0M1VmR2xDd1U/view?usp=sharing
0.2. Choose dem:

https://drive.google.com/file/d/0ByDDImhSolf6cDNtWjlUa3VqdXc/view?usp=sharing
0.3. Downloaded texture:

https://drive.google.com/file/d/0ByDDImhSolf6eXRpYlhxMFN3NnM/view?usp=sharing
0.4. Downloaded dem:

https://drive.google.com/file/d/0ByDDImhSolf6MXVLUV9kOG1xR2c/view?usp=sharing

1. Straightforward
vpbmaster --geocentric -d dem/n30_w086_1arc_v3.tif -t texture/2.tif 
-o output/out.osgb

answer:
--geocentric
-d dem/n30_w086_1arc_v3.tif
ADD: dem/n30_w086_1arc_v3.tif
-t texture/2.tif
ADD: texture/2.tif
-o output/out.osgb
Adding terrainTile
Error: vpbmaster can not run without all source data being in the 
correct destination coordinates system, please reproject them.
Recieved signal 15, doing TERMINATE_RUNNING_TASKS_THEN_EXIT.
Setting up MachinePool to use all 8 cores on this machine.
MachinePool::signal(15)
Machine::signal(15)
Machine::cancelThreads() hostname=, threads=8
Cancel thread
Cancel thread
Cancel thread
Cancel thread
Cancel thread
Cancel thread
Cancel thread
Cancel thread
Completed Machine::cancelThreads() hostname=, threads=8

2. osgdem
osgdem --geocentric -d dem/n30_w086_1arc_v3.tif -t texture/2.tif -o 
output/out.osgb

answer:
--geocentric
-d dem/n30_w086_1arc_v3.tif
ADD: dem/n30_w086_1arc_v3.tif
-t texture/2.tif
ADD: texture/2.tif
-o output/out.osgb
Adding terrainTile
DataSet::_run() 0 0
Now checking for plug-in osgPlugins-3.3.8/osgdb_nvtt.dll
osg::Registry::addImageProcessor(ImageProcessor)
Loaded plug-in osgPlugins-3.3.8/osgdb_nvtt.dll and located 
ImageProcessor
started DataSet::createDestination(30)
reprojecting to file temporaryfile_2.tif
ERROR 1: No PROJ.4 translation for source SRS, coordinate
transformation initialization has failed.
Failed to reproject texture/2.tif
Time for after_reproject 0.003934

And here program crashes.

3. Manual reprojection using gdalwarp
3.1. gdalinfo for dem file:
Driver: GTiff/GeoTIFF
Files: n30_w086_1arc_v3.tif
Size is 3601, 3601
Coordinate System is:
GEOGCS[WGS 84,
DATUM[WGS_1984,
SPHEROID[WGS 
84,6378137,298.257223563,

AUTHORITY[EPSG,7030]],

AUTHORITY[EPSG,6326]],
PRIMEM[Greenwich,0],
UNIT[degree,0.0174532925199433],
AUTHORITY[EPSG,4326]]
Origin = (-86.0001384,31.0001391)
Pixel Size = (0.0002778,-0.0002778)
Metadata:
AREA_OR_POINT=Point
DTED_CompilationDate=0002
DTED_DataEdition=02
DTED_DigitizingSystem=SRTM
DTED_HorizontalAccuracy=0013
DTED_HorizontalDatum=WGS84
DTED_MaintenanceDate=
DTED_MaintenanceDescription=
DTED_MatchMergeDate=
DTED_MatchMergeVersion=A
DTED_NimaDesignator=DTED2
DTED_OriginLatitude=030N
DTED_OriginLongitude=086W
DTED_Producer=USCNIMA
DTED_RelHorizontalAccuracy=NA
DTED_RelVerticalAccuracy=0004
DTED_SecurityCode_DSI=U
DTED_SecurityCode_UHL=U
DTED_UniqueRef_DSI=H24 084
DTED_UniqueRef_UHL=H24 084

Re: [osg-users] [vpb] Correct way to get texture data from USGS or any other source?

2015-06-11 Thread Elias Tarasov
Hello!

My statement about the problem, that had been solved, looks a little premature.

The problem: 
Terrain is displayed incorrectly.
Results:
1. https://drive.google.com/file/d/0ByDDImhSolf6cGFyV21PRXZuZHM/view?usp=sharing
2. https://drive.google.com/file/d/0ByDDImhSolf6N3FvRkNJUW1nMlk/view?usp=sharing

Step-by-step actions to make a terrain

0. Gathering required data
0.1. Choose texture:

https://drive.google.com/file/d/0ByDDImhSolf6S3E0M1VmR2xDd1U/view?usp=sharing
0.2. Choose dem:

https://drive.google.com/file/d/0ByDDImhSolf6cDNtWjlUa3VqdXc/view?usp=sharing
0.3. Downloaded texture:

https://drive.google.com/file/d/0ByDDImhSolf6eXRpYlhxMFN3NnM/view?usp=sharing
0.4. Downloaded dem:

https://drive.google.com/file/d/0ByDDImhSolf6MXVLUV9kOG1xR2c/view?usp=sharing

1. Straightforward
vpbmaster --geocentric -d dem/n30_w086_1arc_v3.tif -t texture/2.tif 
-o output/out.osgb

answer:
--geocentric
-d dem/n30_w086_1arc_v3.tif
ADD: dem/n30_w086_1arc_v3.tif
-t texture/2.tif
ADD: texture/2.tif
-o output/out.osgb
Adding terrainTile
Error: vpbmaster can not run without all source data being in the 
correct destination coordinates system, please reproject them.
Recieved signal 15, doing TERMINATE_RUNNING_TASKS_THEN_EXIT.
Setting up MachinePool to use all 8 cores on this machine.
MachinePool::signal(15)
Machine::signal(15)
Machine::cancelThreads() hostname=, threads=8
Cancel thread
Cancel thread
Cancel thread
Cancel thread
Cancel thread
Cancel thread
Cancel thread
Cancel thread
Completed Machine::cancelThreads() hostname=, threads=8

2. osgdem
osgdem --geocentric -d dem/n30_w086_1arc_v3.tif -t texture/2.tif -o 
output/out.osgb

answer:
--geocentric
-d dem/n30_w086_1arc_v3.tif
ADD: dem/n30_w086_1arc_v3.tif
-t texture/2.tif
ADD: texture/2.tif
-o output/out.osgb
Adding terrainTile
DataSet::_run() 0 0
Now checking for plug-in osgPlugins-3.3.8/osgdb_nvtt.dll
osg::Registry::addImageProcessor(ImageProcessor)
Loaded plug-in osgPlugins-3.3.8/osgdb_nvtt.dll and located 
ImageProcessor
started DataSet::createDestination(30)
reprojecting to file temporaryfile_2.tif
ERROR 1: No PROJ.4 translation for source SRS, coordinate
transformation initialization has failed.
Failed to reproject texture/2.tif
Time for after_reproject 0.003934

And here program crashes.

3. Manual reprojection using gdalwarp
3.1. gdalinfo for dem file:
Driver: GTiff/GeoTIFF
Files: n30_w086_1arc_v3.tif
Size is 3601, 3601
Coordinate System is:
GEOGCS[WGS 84,
DATUM[WGS_1984,
SPHEROID[WGS 
84,6378137,298.257223563,

AUTHORITY[EPSG,7030]],

AUTHORITY[EPSG,6326]],
PRIMEM[Greenwich,0],
UNIT[degree,0.0174532925199433],
AUTHORITY[EPSG,4326]]
Origin = (-86.0001384,31.0001391)
Pixel Size = (0.0002778,-0.0002778)
Metadata:
AREA_OR_POINT=Point
DTED_CompilationDate=0002
DTED_DataEdition=02
DTED_DigitizingSystem=SRTM
DTED_HorizontalAccuracy=0013
DTED_HorizontalDatum=WGS84
DTED_MaintenanceDate=
DTED_MaintenanceDescription=
DTED_MatchMergeDate=
DTED_MatchMergeVersion=A
DTED_NimaDesignator=DTED2
DTED_OriginLatitude=030N
DTED_OriginLongitude=086W
DTED_Producer=USCNIMA
DTED_RelHorizontalAccuracy=NA
DTED_RelVerticalAccuracy=0004
DTED_SecurityCode_DSI=U
DTED_SecurityCode_UHL=U
DTED_UniqueRef_DSI=H24 084
DTED_UniqueRef_UHL=H24 084

[osg-users] [vpb] Correct way to get texture data from USGS or any other source?

2015-06-09 Thread Elias Tarasov
Hello!
I try to build map using vpb in ECEF.
According to manuals i've read it needs to start: 
vpbmaster --geocentric -t texture_file -o output_file
So, clearly i need georeferenced texture file. 
On that page:
http://www.osgvisual.org/projects/osgvisual/wiki/OsgTerrainData
there is a bunch of links to get data. Since --geocentric option allows not to 
use elevation data, then only textures are needed.
And here is a problem: i can't get georeferenced textures from USGS. 
All files i choose from different sets there are without georeferenced 
information.

gdalinfo output:

c:\Terrain\1_42822\FL\2007\200701_bay_county_fl_1ft_sp_clr\vol001gdalinfo 
42822.tif
Driver: GTiff/GeoTIFF
Files: 42822.tif
   42822.tfw
Size is 5000, 5000
Coordinate System is:
LOCAL_CS[unnamed,
UNIT[US survey foot,0.3048006096012192,
AUTHORITY[EPSG,9003]]]
Origin = (1655000.3300010,574999.511)
Pixel Size = (1.000,-1.000)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  ( 1655000.330,  574999.510)
Lower Left  ( 1655000.330,  56.510)
Upper Right ( 166.330,  574999.510)
Lower Right ( 166.330,  56.510)
Center  ( 1657500.330,  572499.510)
Band 1 Block=5000x1 Type=Byte, ColorInterp=Red
  Overviews: 1024x1024
Band 2 Block=5000x1 Type=Byte, ColorInterp=Green
  Overviews: 1024x1024
Band 3 Block=5000x1 Type=Byte, ColorInterp=Blue
  Overviews: 1024x1024

gdalwarp output:

c:\Terrain\1_42822\FL\2007\200701_bay_county_fl_1ft_sp_clr\vol001gdalwarp 
-t_srs +proj=longlat +ellps=WGS84 42822.tif 42822_conv.tif
ERROR 1: No PROJ.4 translation for source SRS, coordinate
transformation initialization has failed.
Creating output file that is 5000P x 5000L.
Processing input file 42822.tif.
0...10...20...30...40...50...60...70...80...90...100 - done.

gdalwarp converted file output:

c:\Terrain\1_42822\FL\2007\200701_bay_county_fl_1ft_sp_clr\vol001gdalinfo 
42822_conv.tif
Driver: GTiff/GeoTIFF
Files: 42822_conv.tif
Size is 5000, 5000
Coordinate System is:
GEOGCS[WGS 84,
DATUM[unknown,
SPHEROID[WGS84,6378137,298.257223563]],
PRIMEM[Greenwich,0],
UNIT[degree,0.0174532925199433]]
Origin = (1655000.3300010,574999.511)
Pixel Size = (1.000,-1.000)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  ( 1655000.330,  574999.510) (Invalid angle,Invalid angle)
Lower Left  ( 1655000.330,  56.510) (Invalid angle,Invalid angle)
Upper Right ( 166.330,  574999.510) (Invalid angle,Invalid angle)
Lower Right ( 166.330,  56.510) (Invalid angle,Invalid angle)
Center  ( 1657500.330,  572499.510) (Invalid angle,Invalid angle)
Band 1 Block=5000x1 Type=Byte, ColorInterp=Red
Band 2 Block=5000x1 Type=Byte, ColorInterp=Green
Band 3 Block=5000x1 Type=Byte, ColorInterp=Blue

Reprojection doesn't work and it seems very reasonably, because gdal doesn't 
know the source projection.

vpbmaster output:

c:\Terrainvpbmaster --geocentric -t c:/terrain/42822_conv.tif -o 
c:/terrain/out.osgb
--geocentric
-t c:/terrain/42822_conv.tif
ADD: c:/terrain/42822_conv.tif
-o c:/terrain/out.osgb
Adding terrainTile
Error: vpbmaster can not run without all source data being in the correct 
destination coordinates system, please reproject them.
Recieved signal 15, doing TERMINATE_RUNNING_TASKS_THEN_EXIT.
Setting up MachinePool to use all 8 cores on this machine.
MachinePool::signal(15)
Machine::signal(15)
Machine::cancelThreads() hostname=, threads=8
  Cancel thread
  Cancel thread
  Cancel thread
  Cancel thread
  Cancel thread
  Cancel thread
  Cancel thread
  Cancel thread
Completed Machine::cancelThreads() hostname=, threads=8

BlueMarble data works, but since the best accuracy is about 250 meters, i can't 
create a proper detailed terrain.

What am i doing wrong?
Thanks a lot and best regards!

Elias

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





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


Re: [osg-users] [vpb] Correct way to get texture data from USGS or any other source?

2015-06-09 Thread Elias Tarasov
Hello!
Thanks for quick reply, it helped to solve a problem.

SMesserschmidt wrote:
 Am 09.06.2015 um 11:35 schrieb Elias Tarasov:
 
  Hello!
  I try to build map using vpb in ECEF.
  According to manuals i've read it needs to start:
  vpbmaster --geocentric -t texture_file -o output_file
  So, clearly i need georeferenced texture file.
  On that page:
  http://www.osgvisual.org/projects/osgvisual/wiki/OsgTerrainData
  there is a bunch of links to get data. Since --geocentric option allows not 
  to use elevation data, then only textures are needed.
  
 
 Who told you this? Of course you can use elevation data in geocentric 
 mode ...
 Simply use -t for imagery and -d for digitial elevation data
 

The book is called OpenSceneGraph 3 Cookbook
Authors: 
Rui Wang
Xuelei Qian
Citation:
To build databases in geographic coordinate, we can simply use the --geocentric
option while executing vbpmaster. The complete command is:
# vpbmaster -t data/TrueMarble.4km.10800x5400.tif --geocentric
-o output/out.osgb
Don't doubt the arguments we used this time. Yes, there is no -d option and 
thus no 
elevation map specified. As we have already indicated to use the geocentric 
system 
to build from the source, VPB will automatically use flat sea-level elevation 
data and 
construct the earth geometry according to the given GeoTiff imagery.

 
 
  
  And here is a problem: i can't get georeferenced textures from USGS.
  
 They are referenced, but in a non-supported coordinate frame. I never 
 had problems of this kind yet.
 But there are definitively geo-referenced data-sets on USGS, as I'm 
 using them myself.
 

Yes, they are. Just in a different projection, it seems.

 
 Use LandSAT imagery, which is WGS84 projected, so there should no 
 problems here.
 

Actually, problems are exist. This is the LandSat image from USGS

c:\Terrain\EPP191R025_7F19990915gdalinfo test_texture.tif
Driver: GTiff/GeoTIFF
Files: test_texture.tif
Size is 17884, 16140
Coordinate System is:
PROJCS[WGS 84 / UTM zone 33N,
GEOGCS[WGS 84,
DATUM[WGS_1984,
SPHEROID[WGS 84,6378137,298.257223563,
AUTHORITY[EPSG,7030]],
AUTHORITY[EPSG,6326]],
PRIMEM[Greenwich,0],
UNIT[degree,0.0174532925199433],
AUTHORITY[EPSG,4326]],
PROJECTION[Transverse_Mercator],
PARAMETER[latitude_of_origin,0],
PARAMETER[central_meridian,15],
PARAMETER[scale_factor,0.9996],
PARAMETER[false_easting,50],
PARAMETER[false_northing,0],
UNIT[metre,1,
AUTHORITY[EPSG,9001]],
AUTHORITY[EPSG,32633]]
Origin = (391518.750,5685165.750)
Pixel Size = (14.250,-14.250)
Metadata:
  AREA_OR_POINT=Point
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  TIFFTAG_XRESOLUTION=72
  TIFFTAG_YRESOLUTION=72
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  391518.750, 5685165.750) ( 13d26'37.19E, 51d18'26.83N)
Lower Left  (  391518.750, 5455170.750) ( 13d30'34.78E, 49d14'22.90N)
Upper Right (  646365.750, 5685165.750) ( 17d 5'58.23E, 51d17'56.30N)
Lower Right (  646365.750, 5455170.750) ( 17d 0'37.84E, 49d13'54.52N)
Center  (  518942.250, 5570168.250) ( 15d15'57.15E, 50d17' 0.02N)
Band 1 Block=17884x1 Type=Byte, ColorInterp=Red
Band 2 Block=17884x1 Type=Byte, ColorInterp=Green
Band 3 Block=17884x1 Type=Byte, ColorInterp=Blue

Now datum is WGS84, but vpbmaster shows again
Error: vpbmaster can not run without all source data being in the correct 
destination coordinates system, please reproject them.

Maybe because PROJCS[WGS 84 / UTM zone 33N, not just WGS84?


 
 If you need some sample data I can share a small set on googledrive etc.
 

That's very kind, Sebastian, but the problem seems to have been solved already.

To use data with vpb i need to reproject them.

gdalwarp -s_srs EPSG:2238 -t_srs EPSG:4326 src.tif dst.tif

Now produced *.osgb image looks correctly into OSG viewer. However, it also 
looks quite plain. So elevation data is needed?

Thanks a lot!

Elias

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

Post generated by Mail2Forum

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





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


Re: [osg-users] [vpb] Correct way to get texture data from USGS or any other source?

2015-06-09 Thread Elias Tarasov
Hello!


Christian Schulte wrote:
 Hello!
 
 I totally agree with Sebastian. These data is surely geo-referenced, as 
 I myself often used in the past data from USGS. Locking at the metadata 
 you provided I would say that you are in an EPSG:2238 Lambert Conformal 
 Conic projection, which is the main projection system for north Florida. 
 You may try to specify to GDAL the source projection using this EPSG code.
 
 Regards,
 
 Christian
 

Yes, it worked! However, i dont understand how did you figure out that 
projection is 2238. No such a number is presented into metadata. 
For a test, i also used EPGS:3857 and it seems to work similar.

Thanks a lot!

Elias.

Post generated by Mail2Forum

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





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


Re: [osg-users] [vpb] Unusual Error while running vpbmaster

2015-05-07 Thread Elias Tarasov
Hi!

Im sorry for misleading you about that. Actually, release version of vpbmaster 
crushes at runtime at all. However, debug version runs ok (at least, without 
crushes i mean). 
When vpbmaster invokes osgdem, it can call only a release version (literally, 
without d suffix). 
So: vpbmasterd invokes osgdem (without d suffix), and vpbmaster invokes 
osgdem. I think it is hardcoded somehwere in a code. 
So to avoid this, i built a debug versions, but without d suffix, and 
therefore debug version of vpbmaster and all other apps are without d. 

However, they are all debug versions, since release are crashes. 

But now i would like to concentrate at aformentioned problem, instead of 
debug/release issues.

Thank you!

Cheers,
Elias

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





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


Re: [osg-users] [vpb] Unusual Error while running vpbmaster

2015-05-07 Thread Elias Tarasov
Hi!

Problem solved. The issue was the old version of OSG. Appropriate revision 
number must be taken from VPB's ChangeLog. 

Thank you!

Cheers,
Elias

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





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


Re: [osg-users] [vpb] Unusual Error while running vpbmaster

2015-05-06 Thread Elias Tarasov
Hi!

I get the same error: vpb seems try to load osgdb_sourced.dll.
My configuration:
OS MS Windows 7.
Compiler: MSVC 2012 Express Edition. 
I built OSG, GDAL, VPB from sources.
OSG: 3.2.0 
GDAL: 1.11.2
VPB: master

I built only 32-bit versions.

When i launch: vpbmaster -d c:/terrain/gcanyon_height.png -t 
c:/terrain/gcanyon_color_4k2k.png -o c:/terrain/out.osgb

i get errors like:

machine= running task=tasks/build_subtile_L2_X0_Y0.task
scheduling task : tasks/build_subtile_L2_X1_Y0.task

No data loaded
Error: unable to load source file build_master.source
   the file was found as build_master.source
   now setting NotifyLevel to DEBUG, and re-running load:

VPBReaderWriter::readNode()
readNode_old()
itr='c:\VirtualPlanetBuilder\install\bin'
FindFileInPath() : trying 
C:\VirtualPlanetBuilder\install\bin\osgPlugins-3.2.0\osgdb_sourced.dll ...
itr='c:\OpenSceneGraph-3.2.0\install\bin'
FindFileInPath() : trying 
C:\OpenSceneGraph-3.2.0\install\bin\osgPlugins-3.2.0\osgdb_sourced.dll ...
itr='C:\Windows\system32'
FindFileInPath() : trying 
C:\Windows\system32\osgPlugins-3.2.0\osgdb_sourced.dll ...
itr='C:\Windows\System'
FindFileInPath() : trying C:\Windows\System\osgPlugins-3.2.0\osgdb_sourced.dll 
...
itr='C:\Windows'
FindFileInPath() : trying C:\Windows\osgPlugins-3.2.0\osgdb_sourced.dll ...
itr='.'
FindFileInPath() : trying 
C:\VirtualPlanetBuilder\install\bin\osgPlugins-3.2.0\osgdb_sourced.dll ...
itr='c:\OpenSceneGraph-3.2.0\install\bin'
FindFileInPath() : trying 
C:\OpenSceneGraph-3.2.0\install\bin\osgPlugins-3.2.0\osgdb_sourced.dll ...
itr='c:\OpenSceneGraph-3.2.0\install\bin\osgPlugins-3.2.0'
FindFileInPath() : trying 
C:\OpenSceneGraph-3.2.0\install\bin\osgPlugins-3.2.0\osgPlugins-3.2.0\osgdb_sourced.dll
 ...

And this is repeated until all sheduled tasks fail to load osgdb_sourced.dll

Now im looking into code based on comments i've read previously at this topic 
and also at vpb changelog on github.

However, still no success.

Thank you!

Cheers,
Elias

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





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