Weird issue with transparent texture and spatial following FlyCam

Hello all!

I basically have a FlyCam with a sphere I have attached based on infomration from “testlightradius”

[java] lightMdl = new Geometry(“Light”, new Sphere(10, 10, 0.1f));

I have used this and attached it to my rootNode.

in the test there is this line in the simpleUpdate

   [java] lightMdl.setLocalTranslation(pl.getPosition());[/java]

pl in that instance is a pointlight so for me I used this

[java] lightMdl.setLocalTranslation(cam.getLocation().x, -cam.getLocation().z, cam.getLocation().y); [/java]

by calling this line of code I will get the exact movement I want, and it will follow my FlyCam; however my textures in the scene that were transparent now have a white border around them(originally black) in the first cam, and it’s black in the second cam(weird).

if I changed the line of code to [java] lightMdl.setLocalTranslation(cam.getLocation().x, cam.getLocation().z, cam.getLocation().y); [/java]

or others it will be transparent, but any value close to my flyCam will mess up my graphics.

This is extremely weird to me, I am using a CameraNode with my FlyCam for collision detection, and I don’t add the sphere to it(since it wont work for some reason) so I wonderered if it was possibly having z-depth issues with the CameraNode, but I’m not too sure.

Anyone have any idea what it could be?


Well, the little snippets of code you posted are very strange. I’d expect a solid red sphere that moves with y and z flipped from the camera. So if you move the camera up then the sphere will move along the Z-axis, etc…

…so I’m not sure how it moves with the camera at all. There are things you are leaving out of your question.

It’s probably easier if you put together a simple single-class test case that illustrates the issue. Then in the likely case that there is no issue you can figure out what’s different… and in the rarer case that you see the issue even in the test case then you can post it and we can help. Otherwise, this “guess the code” game will go on forever.

Basically I am going from a 2d to a 3d world in my game, and so that is why y and z are switched and z is negative, it’s due to 3d being center and 2d being top left.

I was able to fix it by going up by 15f. Weird, but glad it was fixable, I will try to put together an actual test to see if I can replicate.