Skip to main content

Behavior on Invisible Canvas - RFE

5 replies [Last post]
tcorbet
Offline
Joined: 2004-10-29
Points: 0

I have modified the PrintCanvas3D example program by adding a rotator. Using the sample image object of the Mustang aircraft, the application performs just about the same as with a static scene -- when a menu event for a Snapshot occurs, the rendering of the OffScreen ImageBuffer 'grabs' an image of the aircraft at the rotation that prevailed at the time of the event.

In the application I would like to create, this is a very nice capability BUT...

The but, is that I really don't want to display the 'source behavior', I only want to grab a series of frames that have been rendered according to the power of the Java3D libraries. After trying every combination of methods that seemed likely, I finally concluded that any reason that causes the Canvas widget NOT to be visible, causes the cessation of the behavior rendering. From my reading of the tutorial and javadocs, even though a newbie, I guess I understand the rationale for this. Rather like the behavior of the applet engine, resources need not be consumed when the applet on a page is scrolled out of view, so you don't want to consume the even more substantial resources involved in rendering a behavior that is 'out of view'.

I can think of use cases in which the application designer would like to be able to control that decision directly. If there is some incantation that will allow me to get behavior rendering for a Canvas that is NOT visible, please instruct me. Otherwise, I have modified Canvas3D to enable that state, but it is rather probable that my modification is not entirely valid, and I would much prefer having a valid, supported implementation.

Please consider a RFE; thank you.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rjm49
Offline
Joined: 2012-02-28
Points: 0

Hi tcorbet,

Yes, indeed. It's now 2012 and Java 3D 1.5.2 - and it seems one still cannot do what you requested here.

I have been trying to do precisely the same thing, and I cannot suppress the creation of the onscreen canvas without pausing the animation. If you are still around, let me know whether you made any progress in the last six years!

Thanks, Russell

tcorbet
Offline
Joined: 2004-10-29
Points: 0

Well, in someways I guess being a dinosaur is a good thing. Because I still have the same decades-old email address, and because my browser still remembered my userid and password to this forum, I not only received your inquiry, I was able to reply.

That said, I have nothing useful to offer you. I gave up on building my idea of a rich application using the then-existing Java libraries so long ago that I would not even know where to begin to investigate this particular problem. I moved over to Actionscript which, for the last half-dozen years has provided a really-powerful set of libraries for all things multi-media. The language, with frameworks for either browser-based or native desktop [yep, I'm still a dinosaur, having no access to tablets and smart phones] applications, makes it pretty easy to do what I wanted to do in 2003-6. And by now, as I am sure you will know, the 3D rendering is being accomplished with GPU hardware on the video card.

That's probably no help to you, but its the best I've got.

mcb23
Offline
Joined: 2005-10-26
Points: 0

Can you please post the code that you are using, perhaps we can find a workaround that solves your problem (that i haven't understood ... that's why i'm asking for an example)

cheers,
Chaouki.

tcorbet
Offline
Joined: 2004-10-29
Points: 0

Sorry for the delay in responding; I had checked the box indicating that I wanted to track this item, but received no notices, thanks for your follow-up.

I wish I were as fluent with Java3D as with SWT where I frequently have been able to provide a 'snippet' that, indeed, is a good way for everyone to be able to quickly focus on the matter at hand. Since I don't have the fluencey, the smallest, meaningful example I could send would still require a jar file with other 3rd party classes.

In the meantime, I have been making progress with the issues, so I think I can more cleanly define the requirement just with words.

01. A Java application is driving a display on a pretty conventional PC. In the first release, it just uses the basic J2SE tools for the desktop. In the second release, it enhances the visual appearance with some capabilities from the Java2D API. In the third release it wants to enhance the visual appearance with some capabilities from the Java3D API.

02. The 3D facilities required to enhance an application which is neither designed nor intended to ever become anything as magnificent as a head-mounted involvement in a virtual world are admittedly minimal. In my case, I want to replace some 'sprite' activity, but as I believe that
my Request For Enhancement might be of general interest, please don't take that for a 'specification'. I am certain that more creative developers would have more elaborate ideas of which sub-set of full functionality would be useful.

03. In my case, the sprites are Text3D glyphs that just rotate in a very prosaic manner. But, as you great 3D architects would realize, just doing that simple thing in the 'bounds of influence' of various sources of illumination, yields results that none of the simpler APIs can approach. So, what I have constructed is an On Screen Canvas with its Off Screen partner. The standard Interpolator animates N glyphs in a 3-dimensional space that has, from the standpoint of the single ViewPlatform, no overlap, no occulsion. Effectively I have N independent sprites that I grab from the Off Screen Canvas for painting in the appropriate N Rectangles in my application's UI. The user sees N rotating glyphs.

04. From this use case's point of view, the On Screen Canvas is just a work place where a magnificent graphics pipeline is churning out pixels. I need that graphics pipeline to work, but I don't need that graphics pipeline to render anything on any output device. So, not finding any other way to 'fool the system', I just modified Canvas3D into thinking it was 'live', 'enabled', 'rendering', whatever the various switches, but, in fact the Canvas3D object is NOT made visible via any association with any AWT object. I think that is useful behavior.

Chaouki MAIZA free

java3d-interest@javadesktop.org wrote:

>I have modified the PrintCanvas3D example program by adding a rotator. Using the sample image object of the Mustang aircraft, the application performs just about the same as with a static scene -- when a menu event for a Snapshot occurs, the rendering of the OffScreen ImageBuffer 'grabs' an image of the aircraft at the rotation that prevailed at the time of the event.
>
>In the application I would like to create, this is a very nice capability BUT...
>
>The but, is that I really don't want to display the 'source behavior', I only want to grab a series of frames that have been rendered according to the power of the Java3D libraries. After trying every combination of methods that seemed likely, I finally concluded that any reason that causes the Canvas widget NOT to be visible, causes the cessation of the behavior rendering. From my reading of the tutorial and javadocs, even though a newbie, I guess I understand the rationale for this. Rather like the behavior of the applet engine, resources need not be consumed when the applet on a page is scrolled out of view, so you don't want to consume the even more substantial resources involved in rendering a behavior that is 'out of view'.
>
>I can think of use cases in which the application designer would like to be able to control that decision directly. If there is some incantation that will allow me to get behavior rendering for a Canvas that is NOT visible, please instruct me. Otherwise, I have modified Canvas3D to enable that state, but it is rather probable that my modification is not entirely valid, and I would much prefer having a valid, supported implementation.
>
>Please consider a RFE; thank you.
>[Message sent by forum member 'tcorbet' (tcorbet)]
>
>http://forums.java.net/jive/thread.jspa?messageID=86376
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
>For additional commands, e-mail: interest-help@java3d.dev.java.net
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net