PDA

View Full Version : Problem on adding OSG file


felixchc
10-04-2006, 08:46 PM
Hi,

I am a new user of Vizard and getting problem on importing OSG model into Vizard. The model was perpared using 3D MAX and exported to OSG format. It looks fine when using OSGViewer but with problem in both Vizard 2.5 or 3 Beta. I just try rotate the point of view to the model from left to right, it getting diffrent color from different view. Some point it shows red, just turning a little more, it will turn magenta or cyan. There is only small portion of it showing correct color, silver in color.

I tried many options, like turning on/off lighting and etc, still no help. Could anyone help to have any suggestion.

Attache 3 pictures on 3 different views.

Thanks in advance.

Felix.

farshizzo
10-05-2006, 06:27 PM
Hi,

Does your model have any materials applied to it? After loading the model try changing the color to white just to see if the problem persists:model.color(viz.WHITE)I've never experienced this problem. Could you provide me with a sample model that recreates the problem? If you don't want to post your model on the forum then you can send it directly to me at lashkari@worldviz.com

felixchc
10-05-2006, 08:59 PM
Thanks for prompt reply, farshizzo.

I tried your suggestion but still no good. I had you the model and py file to your email account. It is quick a large model, sorry.

Felix.

farshizzo
10-06-2006, 09:07 AM
Hi,

I looked at your file and experience the same problem here. The problem is that the color for most of the geometry in the model is undefined. This means that the geometry will inherit the color of the last rendered geometry. And depending on the viewpoint the last rendered geometry will change (due to culling), which causes the color to change.

The reason it works with osgViewer is because osgViewer automatically optimizes all models that are loaded. The optimization seems to fix this problem. You can manually perform the optimization in Vizard using the following command:kob = viz.add('kob.osg')
kob.optimize()

Also, when dealing with models this large that take a long time to load, I suggest converting it to the IVE format. It will load MUCH faster. You can create a script to convert your file:kob = viz.add('kob.osg')
kob.optimize()
kob.save('kob.ive')Now you can use the kob.ive file and save yourself a lot of time.

felixchc
10-06-2006, 11:26 AM
Wow, excellent. You gave me a great support on a right direction to solve the problem. Thanks for your fast and valuable help.