Orbiter camera and geometry from Vector3f

  1. Is there a simple Orbiter class so in a SimpleGame, the "target" object (sphere) stays in the middle when moving the mouse? I guess I will have to deal with a Camera object, right? How do I replace the view?


  2. I have computed the midpoints of all triangles in a TriMesh. How do I create a geometry, that shows those midpoints given I have all all Vector3f's to those midpoints? I just want simple dots or circles to be displayed thereā€¦ no Spheres really (too many triangles) :wink:



    TIA

    Karsten
  1. ChaseCamera will do this. Check out the tests related to that.
  2. the Point class can do this, just create Points and add it to the scene.

For 2 you might also consider the com.jme.scene.Line class.

I see. Hopefully adding all those thousands of Geometry subclass Point's doesn't affect performance muchā€¦? I was thinking about something equivalent to



glBegin(GL_POINTS);



for each Vector3f v

  glVertex3f(v.x, v.y, v.z);



glEnd();



as ONE geometry you know, but addable to the scene graph (so using LWJGL is out of the question I supposeā€¦)



Karsten

Can I achieve this through the GeometryCreator util class?

You can add as many points (or lines) in a single Geometry Point class as you wish, don't make a new Point class for each one.

Ah, OK. Doesn't sound logic the way the Point class is named, but if it works, ok. I'll have a look at itā€¦

Works great. Is there any easy way to have points that react to the camera perspective?? Probably need some triangle fans to render or some other filled Circle geometry huh?

mojomonk said:

1. ChaseCamera will do this. Check out the tests related to that.


I might be too stupid in my current state (Friday night almost 11 p.m. :) ) But where are the sources for the test and ChaseCamera to look at?

Still couldn't find the sourcesā€¦

It's used by ThirdPersonController, so any test that makes use of that: TestShadowPass, TestSpatialLookAt. jmetest.input.RenControllerEditor will allow you to play with the setting in real time, good place to learn from.

Hmmm do I get the sources via CVS only?

Follow the nightly build link on the main page, and you can dl. some recent sources.

Ah great thanks!



Is there any easy way / method call(s) to fix the camera so it doesn't do this up/down jumping? I find that a little disturbingā€¦



Karsten