Scene node distance too short b4 dissappearing

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Scene node distance too short b4 dissappearing

Post by [dx/x]=HUNT3R »

I have a star in space that shines light on all other objects in space. I am using a billboardSceneNode to show a sprite of a star so that it actually looks like a sun. But when the camera moves too far away (about 3500-4000 units) the sprite will dissappear. If I move the camera around then it will reappear only in the edges of the viewing frustrum (in the corners of the screen) and not in the middle when I look directly at it. Whats up with that? Anyone know a work around for this such that the sprite will be visible from further away until it winks away into nothing? Here's the code I'm using to make the star:

light = device->getSceneManager()->addLightSceneNode(0, core::vector3df(0,0,-3000), video::SColor(255, 255, 255, 255), 1500.0f);
star = device->getSceneManager()->addBillboardSceneNode(light, core::dimension2d<f32>(300,300));
star->setMaterialFlag(video::EMF_LIGHTING, false);
star->setMaterialTexture(0, driver->getTexture("particlewhite.jpg"));
star->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);

Anyone got any ideas? I thought about just using a model and putting lights all around the model but the model might look kinda cheesey since it's supposed to be a blinding hot star...
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

That's because the billboard is clipped. Just increase the Far value of your camera. You can change it with camera->setFarValue. Set it to the longest distance you want to be visible.
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post by [dx/x]=HUNT3R »

Awesome Niko, Thanks. That werkx, but I've also noticed that when the camera is moved around with the mouse that a model of, for example, a planet which is just a big round ball, appears to stretch when the model is in the edge of the FOV, but then is perfectly circular when straight ahead. Is this something that can be adjusted and fixed also?
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Yes, you could play around with camera->setAspectRatio(). Maybe it helps.
Post Reply