Re: [osg-users] Dynamic surface coloring

2012-01-15 Thread J.P. Delport

Hi,

try image->dirty() after you've changed it. It's normally not needed to 
texture->setImage(image); again.


jp

On 15/01/2012 11:12, Kevin Williams wrote:

As an experiment I have got a single triangle, and applied a list of colours as 
a texture across it. (I modifed the osgtexture1d example.) [The idea is now to 
create thin triangles representing each azimuth cell, and update the texture 
colours on each triangle as measurements become available.]

I've been trying to modify the colour list on the fly by changing entries in 
the image defining the texture, but this change is not rendered. Just for the 
experiment I included this code in the animate callback:

osg::Vec4* dataPtr = (osg::Vec4*)image->data();
dataPtr[0] = osg::Vec4(float(rand())/RAND_MAX,float(rand())/RAND_MAX, 
float(rand())/RAND_MAX,1);
texture->setImage(image);

What is the correct way to change textures while running?

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





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



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


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.


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


[osg-users] osgvolume opacity settings

2012-01-15 Thread Clement.Chu
Hi,

   My application is using osgvolume to display CT data.  There is class called 
CompositeProperty and there are three property classes (AlphaFuncProperty, 
SampleDensityProperty and TransparencyProperty) as well.  I would like to know 
more details of those classes and how to apply on osgvolume.  I did to follow 
the example to use those classes, but when I changed the value of 
SampleDensityProperty from 0.05 to 0.5.  Some CT data are disappear, so I would 
like to know more how to control property values.  Many thanks.


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


[osg-users] Place axes at corner

2012-01-15 Thread Clement.Chu
Hi,

   I have created axes to display on viewer, but I have no idea to place it at 
the bottom corner of the view.  Anyone know how to location the corner of the 
view?  Many thanks.


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


Re: [osg-users] Installation Problems.VS10 - unresolved external symbol

2012-01-15 Thread Kirill Serebtiakov
Ok.After brief reflection, I decided that the problem with
x64 was because i've tried to compile it like x86 Application (yes,my bad).
x86 was because i've changed Environment variable and didn't reboot my system, 
so when it tried to compile project, it used .dll files from x64 bin folder, 
that was set in path variable before.
As a result, I had the same errors in both cases.
btw switching between Multi-Byte Character Set / Unicode Character Set does not 
affect the work of application.
Anyway, I want to share my experience of the pre-compiled OSG setup for VS10. 
Hope it will be useful for someone.
Here is my step-by-step instructions for Dummies.
1. Download latest version of pre-compiled binaries from AlphaPixel 
(http://openscenegraph.alphapixel.com/osg/downloads/free-openscenegraph-binary-downloads).
 You will need at least two archives x86-debug&x86-release or/and 
x64-debug&x64-release
2. Unpack debug and release into one folder. (u will have 
bin,data,doc,include,lib,share folders). If u install x86 and x64, You can 
remove doc, data from one folder because it is the same files. (I've made root 
folder OSG,which contains data,doc,x64,x86 folders.And x86/x64 contains 
bin,lib,include folders.) You can also remove share folder, you dont need it 
for work.
3. Configure your Environment variables (choose one step only)
3.1 Do it yourself
3.1.1 Right click on the Computer icon and choose Properties option.
3.1.2 In the System window click on Advanced system settings in the left pane.
3.1.3 In the System Properties window select Advanced tab and click on 
Environment Variables… button.
3.1.4 In the Environment Variables window you will notice two columns User 
variables for a username and System variables. You should edit system vars.

Code:
OSG_ROOT - your OSG root folder
OSG_BIN_PATH = %OSG_ROOT%\bin 
OSG_INCLUDE_PATH = %OSG_ROOT%\include 
OSG_LIB_PATH = %OSG_ROOT%\lib 


not necessary:

Code:
OSG_SAMPLES_PATH = %OSG_ROOT%\share\OpenSceneGraph\bin 
OSG_FILE_PATH = %OSG_ROOT%\data
path = %path%;%OSG_BIN_PATH%;%OSG_SAMPLES_PATH%;


btw try to avoid spaces in your paths
3.2 Use batch file

Code:
@echo off
rem Tested on Win7x64, pre-compiled OSG 3.0.1 from AlphaPixel, VisualStudio2010
rem must work on Win7&Vista x86/x64
rem ©Kirill Serebriakov (17:06 14.01.2012)

set x86path=--!SET PATH TO YOUR X86 osg FOLDER!--
set x64path=--!SET PATH TO YOUR X64 osg FOLDER!--

rem data folder is not necessary
set data=--!SET PATH TO YOUR X64 data FOLDER!--
IF NOT EXIST %x86path% (echo x86path is not set or incorrect
GOTO x64)
:x86
SETX OSG_ROOTx86 %x86path% -m
SETX OSG_BIN_PATHx86 %%OSG_ROOTx86%%\bin -m 
SETX OSG_INCLUDE_PATHx86 %%OSG_ROOTx86%%\include -m
SETX OSG_LIB_PATHx86 %%OSG_ROOTx86%%\lib -m
:x64
IF NOT EXIST %x64path% (echo x64path is not set or incorrect 
GOTO finish)
SETX OSG_ROOTx64 %x64path% -m
SETX OSG_BIN_PATHx64 %%OSG_ROOTx64%%\bin -m
SETX OSG_INCLUDE_PATHx64 %%OSG_ROOTx64%%\include -m
SETX OSG_LIB_PATHx64 %%OSG_ROOTx64%%\lib -m
:finish
IF EXIST %data% (SETX OSG_FILE_PATH %data% -m)
echo reboot Your system
pause


and this one to delete paths

Code:
@echo off
:x86
echo Removing x86 OSG path
REG delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" 
/f /V OSG_ROOTx86
REG delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" 
/f /V OSG_BIN_PATHx86
REG delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" 
/f /V OSG_INCLUDE_PATHx86
REG delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" 
/f /V OSG_LIB_PATHx86
:x64
echo Removing x64 OSG path
REG delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" 
/f /V OSG_ROOTx64
REG delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" 
/f /V OSG_BIN_PATHx64
REG delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" 
/f /V OSG_INCLUDE_PATHx64
REG delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" 
/f /V OSG_LIB_PATHx64
:data
REG delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" 
/f /V OSG_FILE_PATH
:finish
echo reboot Your system
pause


3.3 Or you can skip this step, but you'll have to spend a little more time to 
configure Visual Studio
4. Don't forget to reboot your system if u change Environment variables.
5. Open Visual Studio. File -> New -> Project -> Visual C++ -> Empty Project 
6. Config your project. Project -> Properties
6.1. You must set path to your lib folder and include folder

Code:
C/C++ -> General -> Additional Include Directories add $(OSG_INCLUDE_PATH) 
Linker -> General -> Additional Library Directories add $(OSG_LIB_PATH) 


or

Code:
VC++ Directories -> Include Directories add $(OSG_INCLUDE_PATH) 
VC++ Directories -> Library Directories add $(OSG_LIB_PATH) 


if you skiped step 3, you must set absolute path to your folders.
6.2. Add Lib files

Code:
Linker -> Input -> Additional Dependencies add all .lib files that you need 
(for Debug LibNamed.lib)/with

Re: [osg-users] Dynamic surface coloring

2012-01-15 Thread Kevin Williams
As an experiment I have got a single triangle, and applied a list of colours as 
a texture across it. (I modifed the osgtexture1d example.) [The idea is now to 
create thin triangles representing each azimuth cell, and update the texture 
colours on each triangle as measurements become available.]

I've been trying to modify the colour list on the fly by changing entries in 
the image defining the texture, but this change is not rendered. Just for the 
experiment I included this code in the animate callback:

osg::Vec4* dataPtr = (osg::Vec4*)image->data();
dataPtr[0] = osg::Vec4(float(rand())/RAND_MAX,float(rand())/RAND_MAX, 
float(rand())/RAND_MAX,1);
texture->setImage(image);

What is the correct way to change textures while running?

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





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