StandardGame and DisplaySystem (setMinSamples)

Hi,



it is possible to change the MinSamples of the DisplaySystem with a StandardGame class.



I know, i must change the MinSamples before calling the "run" Method. But I have no access

to the DisplaySystem before the window is created. I also cannot extend the StandardGame

class, because its final.



Any tipps are welcome :slight_smile:



Sorry for my bad english.



Mewel

You can change the samples value by modifying the GameSettings object before passing it to StandardGame. However right now it's useless since there's no way to enable multisampling.

Big thanks, it work, but why do you mean it is useless?







When I set samples from 0 to 4, I get this.





Ok, but I have another question :).



How can I set the camera view to a specific point.



DisplaySystem display = DisplaySystem.getDisplaySystem();
Camera cam = display.getRenderer().getCamera();
cam.setFrustumPerspective(45.0f, (float) display.getWidth() / (float) display.getHeight(), 1, 500);
Vector3f loc = new Vector3f(70.37594f, -58.616173f, 51.6933f);
Vector3f left = new Vector3f(0.0f, 1.0f, 0f);
Vector3f up = new Vector3f(0.0f, 0f, 1.0f);
Vector3f dir = new Vector3f(1f, 0f, 0.0f);
cam.setFrame(loc, left, up, dir);



With this, I set the camera to the loc coordinate. I tried alot but with lookAt or
changing the dir, I always "destroy" my FirstPersonHandler.
Is there no function like in 3ds Max. Camera in point x,x,x and lookAt y,y,y and all
the other stuff works with?

I guess your video card automatically activates multisampling if the display is initialized with more than 0 samples…

For your question, you can use Camera.setLocation and then Camera.lookAt to do what you want.

I know that lookAt do the job, but lookAt needs an up vector and does not calculate them automatically, so i dont know how to calculate it :/.


DisplaySystem display = DisplaySystem.getDisplaySystem();
Camera cam = display.getRenderer().getCamera();
cam.setFrustumPerspective(45.0f, (float) display.getWidth() / (float) display.getHeight(), 1, 500);
Vector3f loc = new Vector3f(70.37594f, -58.616173f, 51.6933f);
Vector3f left = new Vector3f(0.0f, 1.0f, 0f);
Vector3f up = new Vector3f(0.0f, 0f, 1.0f);
Vector3f dir = new Vector3f(1f, 0f, 0.0f);
cam.setFrame(loc, left, up, dir);

Highlighted above is the up vector.
Momoko_Fan said:
However right now it's useless since there's no way to enable multisampling.


fyi, I've "backported" that change from the 2.0 code (just now), so it will properly enable multisample when samples > 0.