World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 03-16-2011, 03:02 PM   #41
brujito
Member
 
Join Date: May 2009
Posts: 58
brujito is on a distinguished road
Default

Hi,
I've faced interesting problem with jaxb-collada/ardor3d in my application.
My application is Eclipse-based and WWJ is intergrated with SWT GLCanvas (not SWT_AWT bridge). I've taken jaxb-collada and ardor3d-0.7. Standalone Test3D example works as expected, but as soon as I put Movable3DModel in my application it is broken:



After some debugging I've located some code in ardor3d JoglTextureStateUtil.
They enumerate texture units of GPU and store loaded texture ID for each of them.
WWJ in turn uses GL_TEXTURE0 and GL_TEXTURE1 texture units (and maybe other).
This leads to inconsistent state in both Ardor3D and WWJ.
My first workaround was to force Ardor3D using texture units starting from GL_TEXTURE0+8.
Anybody have some ideas what would be better solution and why simple example works?
brujito is offline   Reply With Quote
Old 03-16-2011, 04:10 PM   #42
brujito
Member
 
Join Date: May 2009
Posts: 58
brujito is on a distinguished road
Default

I also wonder why ArdorModelRenderer is singleton and it keeps single Node. Once model is loaded application won't be able to render other model.
Isn't it better to implement new class Ardor3DModel that keeps one Node inside. I'll attach my code later.
brujito is offline   Reply With Quote
Old 03-16-2011, 06:15 PM   #43
mike.emery
Code Monkey
 
Join Date: May 2008
Posts: 37
mike.emery is on a distinguished road
Default

brujito, your model corruption looks similar to what I ran into. I added GL_CLIENT_VERTEX_ARRAY_BIT to the list of things to push before/pop after rendering the model. It could be you're missing that or another of the states.

These threads may be useful:
http://ardor3d.com/forums/viewtopic.php?f=10&t=1091
http://forum.worldwindcentral.com/sh...ighlight=ardor

Regarding storing the node in an ArdorModelRenderer: Our ArdorModel class contains the node as you mention. If you used the example code at the start of this thread as a starting point- keep in mind it was very early proof of concept code and not really suitable for general consumption.
mike.emery is offline   Reply With Quote
Old 03-21-2011, 05:25 AM   #44
what_nick
Worldwind Developer
 
Join Date: Jan 2006
Location: Hobart, Australia
Posts: 754
what_nick is an unknown quantity at this point
Default

Hi Mike,

I used the sample code in my model loader proof of concept. This is what brujito is using. The singleton is indeed not necessary/appropriate. Please submit a patch against the mercurial repository with your non-singleton suggestion.

Make your clone and work from there:

http://code.google.com/p/jaxb-collada/source/clones

I will start taking pushes from people as soon as someone does one Be brave and PUSH.

Cheers,

whatnick.
__________________
Coding This and That in World Wind and helping new people out, as long as they don't pester too much.
Currently blogging at: http://whatnicklife.blogspot.com
Working at:
Aerometrex - http://aerometrex.com.au/blog/
Impact so far:


what_nick is offline   Reply With Quote
Old 03-21-2011, 09:36 AM   #45
brujito
Member
 
Join Date: May 2009
Posts: 58
brujito is on a distinguished road
Default

mike.emery, unfortunately that was not my case, pushing GL_CLIENT_VERTEX_ARRAY_BIT didn't help.
I also suggest one more imporvement: loading model in World Wind task service so WWJ won't freeze.

My version is here:
Code:
hg clone https://drykovanov-collada.googlecode.com/hg/ drykovanov-collada

Last edited by brujito; 03-21-2011 at 01:51 PM.
brujito is offline   Reply With Quote
Old 03-21-2011, 12:56 PM   #46
brujito
Member
 
Join Date: May 2009
Posts: 58
brujito is on a distinguished road
Default

I've made test model in Google Sketchup. It has two rectangles, one with different textures on sides, other with different colors. I can't get it rendered correctly. I either get "hedghog" picture or wrong textures and colors.

I'd like to ask you to load this model and attach results in this thread.

Please observe that first rectangle is with single texture on both sides and second is without color applied.

Attached Images
File Type: jpg material1.jpg (195.7 KB, 525 views)
File Type: jpg material2.jpg (191.0 KB, 507 views)
Attached Files
File Type: zip models.zip (72.2 KB, 105 views)
brujito is offline   Reply With Quote
Old 03-22-2011, 01:22 AM   #47
what_nick
Worldwind Developer
 
Join Date: Jan 2006
Location: Hobart, Australia
Posts: 754
what_nick is an unknown quantity at this point
Default

Thanks for the help Brujito. Shouldn't the model class extend the existing model abstraction to reuse all the yaw,pitch etc. I will pull in your changes and add the extension. The Model base class possible needs to be refactored.

Cheers,

whatnick.
__________________
Coding This and That in World Wind and helping new people out, as long as they don't pester too much.
Currently blogging at: http://whatnicklife.blogspot.com
Working at:
Aerometrex - http://aerometrex.com.au/blog/
Impact so far:


what_nick is offline   Reply With Quote
Old 03-22-2011, 02:52 AM   #48
what_nick
Worldwind Developer
 
Join Date: Jan 2006
Location: Hobart, Australia
Posts: 754
what_nick is an unknown quantity at this point
Default

You are also missing the apache commons logging in extlib (my very non-standard dependency management setup). I have added it there for consistency.

Cheers,

whatnick.
__________________
Coding This and That in World Wind and helping new people out, as long as they don't pester too much.
Currently blogging at: http://whatnicklife.blogspot.com
Working at:
Aerometrex - http://aerometrex.com.au/blog/
Impact so far:


what_nick is offline   Reply With Quote
Old 03-22-2011, 03:17 AM   #49
what_nick
Worldwind Developer
 
Join Date: Jan 2006
Location: Hobart, Australia
Posts: 754
what_nick is an unknown quantity at this point
Default

I have tested your model and I have the same result as you. Can you attach the results of the expected render output. Does it render correctly in the standalone Ardor3D renderer ? Please attach a screenshot of what you expect to see. Ardor and WorldWind may be fighting over the texture units.

I have also added your model to the repo as a test case.

Cheers,

whatnick.
__________________
Coding This and That in World Wind and helping new people out, as long as they don't pester too much.
Currently blogging at: http://whatnicklife.blogspot.com
Working at:
Aerometrex - http://aerometrex.com.au/blog/
Impact so far:


what_nick is offline   Reply With Quote
Old 03-22-2011, 01:51 PM   #50
brujito
Member
 
Join Date: May 2009
Posts: 58
brujito is on a distinguished road
Default

what_nick,
I'm not very good with Maven and I work in Eclipse. Just forgot to add dependency.
Stand-alone Ardor3D ColladaViewer has the same problem. Here is attached screenshot from Google Earth:
Attached Images
File Type: jpg ge_collada.jpg (41.3 KB, 495 views)
brujito is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
WorldWind Compiling Guide Without Visual Studio rnielsen Developers' Corner 30 06-06-2011 02:55 PM
How to integrate Worldwind into a B/S system javen Development Help 4 11-08-2010 01:51 PM
WorldWind rendering mchristyuk Development Help 6 01-28-2009 08:28 PM
Reg compiling the source code Raj Developers' Corner 10 08-26-2008 06:58 PM
Newbies guide to worldwind Llynix WorldWind General 14 12-25-2004 01:55 PM


All times are GMT +1. The time now is 12:48 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.