MotionPath/Beziercurves and app-initialize before parent frame was visible

Hi,



i’ve two questions:


  1. Is it possible to attach a spline to a motionpath? In jme2 it was possible to use the curve controllers. Now i miss the possibility to move a geometry along a bezier curve and if i’m right bezier splines cannot be used in association with motionpaths/tracks? Wouldn’t it be better to have the possibility to attach a spline or curve manually at a motionpath?


  2. I’m using jme3 as part of a greater project in a canvas. My problem is, that the applications initialize()-method will not called until the parent frame was set visible. Is there a possibility to initialize the application before the frame has been visible? I would like to initialize all until the application appears at the screen.



    Regards

    Moe
  1. There are curves, but idk how they are used exactly, many @nehon can help
  2. Yes, @Momoko_Fan fixing this by making the context start without the window having to be open. This will effectively give you a null renderer while the window is not opened but will allow you to use the update loop without problems. It will also fix the jMP freezing issues because jme will not block on the EDT anymore.

Hey thanks for the fast reply:


  1. Well i think it would be much easier to attach a spline, than calculating the interpolation based on a private spline.
  2. Ok, i’ll try it. What i definitly need to instantiated before is the camera, assetmanager and inputmanager.



    Edit: Argh, and the main viewport :wink:

All of the jme3 viewports, objects etc should be no problem, as long as your code works with the null renderer it will work with the canvas at any time too. If you access OpenGL directly (which you shouldn’t do anyway) then you’re screwed :wink:

That’s great … :slight_smile:



And when do i have to apply the LWJGL-Renderer, because if the frame is shown the lwjgl renderer should be used.

Saw that there was a big update about that initiaize and update stuff.

Don’t now why but now my app is broken:



[java]Exception in thread “LWJGL Renderer Thread” java.lang.NullPointerException

at org.lwjgl.opengl.GL11.glViewport(GL11.java:3477)

at com.jme3.renderer.lwjgl.LwjglRenderer.setViewPort(LwjglRenderer.java:595)

at com.jme3.renderer.RenderManager.setViewPort(RenderManager.java:617)

at com.jme3.renderer.RenderManager.setCamera(RenderManager.java:665)

at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:701)

at com.jme3.renderer.RenderManager.render(RenderManager.java:741)

at framework.jme3.CityApplication.update(CityApplication.java:391)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:137)

at com.jme3.system.lwjgl.LwjglCanvas.runLoop(LwjglCanvas.java:191)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:205)

at java.lang.Thread.run(Thread.java:662)[/java]

Sorry i didn’t see this post before, please use a more explicit title to your posts, we are reading a lot of them and a catchy title can help a lot. :wink:



I can indeed help with question 1.

you can use MotionPath and use MotionTrack as a control over a spatial.

The MotionPath use a spline in the end, I guess I could add a constructor that have a spline parameter.

Note that for now MotionPath only support Linear and Catmull Rom interpolation, Bezier has been added to splines, but is not yet supported by motionPath.



Look at TestMotionPath or TestCameraMotionPath for an example on how to use it.

Hi @nehon,



thanks for the reply and yes you’re right, the title could have been much more better but i invested at least half an hour to think about what title would be better. :wink:



I know how to use the motion stuff, i only miss bezier curves :wink: I try to bring our project from jme2 to jme3 and that’s the last thing what has to be done :wink:

Any ideas about my last entry?



Regards

Moe



Edit: Hope the new topic will explain it better.

oOMoeOo said:
I know how to use the motion stuff, i only miss bezier curves ;) I try to bring our project from jme2 to jme3 and that's the last thing what has to be done ;)

Well, two options for you then, wait for me to do it, but I can't say when this will be done. Or...make it yourself and post a patch :D.
The main problem with bezier is that the resulting curve does not go through the control points, so the motionPath would need some adaptations.

for the second problem i'm afraid i can't really help you.

Ok thank, maybe i’ll fix it if there is enough time.

About the exception problem maybe shadowislord could say something. Latest revision says that there was a big refactoring.

Well i think i found the problem. I don’t inherit the SimpleApplication, i use the Application directly as parent class. The following lines seemed to cause the problem:



[java]if (context.isRenderable()){

renderManager.render(tpf);

}[/java]



But now the canvas stays red all the time. Nothing to see anymore :frowning:



That’s what it looks like if the frame is shown:





Edit: It seems that the input system doesn’t work anymore.

There should be some messages going back and forth that start with “OGL” and “EDT” in the log, can you post them?

Hi @Momoko_Fan,



unfortunately there aren’t any messages starting with OGL or EDT. Since the last update (rev. 7095) the canvas works. My program was adjusted to receive the initialize events even if the parent frame was set visible. There will be some changes now i think. Will give you a word if it works again…

Yeah it works now. Thanks



Regards

Moe