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 08-22-2012, 06:48 PM   #1
kook04
Junior Member
 
Join Date: Aug 2012
Posts: 19
kook04 is on a distinguished road
Default Need some help/advice on creating a "composite" Renderable

Hey all. Hopefully someone has some insight on accomplishing what I'm trying to do. Basically, I'm trying to create a custom Renderable class which is made up of multiple existing World Wind Renderables. In this example, a SurfaceIcon and a GlobeAnnotation.

I'm essentially trying to create a labelled icon, which I can further customize one I get the basics figured out.

My methodology is as follows, but it's not working completely.

Create a new MapItem class which implements Renderable and Movable. This MapItem class encapsulates both a SurfaceIcon and GlobeAnnotation. The MapItem is constructed with a Position, which is passes through to both the icon and annotation.

As far as the methods of the Renderable and Movable interfaces go, I just pass the appropriate parameters through to both of the objects held withing (icon and annotation).

When I do this, only the GlobeAnnotation is showing up on the map. Any ideas?

Thanks.
kook04 is offline   Reply With Quote
Old 08-22-2012, 10:00 PM   #2
dcollins
WWJ Dev. Team
 
Join Date: May 2007
Posts: 449
dcollins is on a distinguished road
Default

Are you forwarding the preRender call to SurfaceIcon?
dcollins is offline   Reply With Quote
Old 08-25-2012, 02:58 PM   #3
pabercrombie
WW Dev. Team
 
Join Date: Sep 2010
Location: Boston, MA, USA
Posts: 325
pabercrombie is on a distinguished road
Default

You're on the right track, but you also need to implement PreRenderable. Implement preRender to call preRender on the SurfaceIcon. (Things drawn on the surface of the globe need to be assembled before the scene is rendered. If you call render on the SurfaceIcon without calling preRender, it won't draw anything.)
pabercrombie is offline   Reply With Quote
Old 08-27-2012, 11:53 PM   #4
tag
WWJ Technical Manager
 
Join Date: May 2007
Location: Seattle
Posts: 1,041
tag is on a distinguished road
Default

Take a look at OSMWayShape in the new openstreetmap package of worldwindx.
tag is offline   Reply With Quote
Old 08-28-2012, 01:16 PM   #5
kook04
Junior Member
 
Join Date: Aug 2012
Posts: 19
kook04 is on a distinguished road
Default

Thank you all for your responses! The PreRenderable interface was the issue. I had no idea it existed. Once I implemented that in my custom class and forwarded calls to the SurfaceIcon, the icon started showing up.

Thanks again.
kook04 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
One-time init method with DrawContext for setting up VBO for Renderable? expressoCoder Development Help 1 08-24-2010 08:11 AM
Icon as Renderable tingspain Development Help 4 04-27-2009 05:01 PM
Suggestion for Renderable interface remleduff Development Help 2 01-29-2008 05:01 PM
And Renderable for all... asantiago Development Help 2 11-23-2007 05:06 PM
Renderable Icon: Go where I send thee rideabike Developers' Corner 0 10-30-2007 06:22 PM


All times are GMT +1. The time now is 06:07 AM.


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