Defining a TriangleSelector without an associated mesh

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
Ablaze
Posts: 4
Joined: Sat Jan 22, 2005 9:18 pm

Defining a TriangleSelector without an associated mesh

Post by Ablaze »

I'm trying to make a space based scene and allow the user to select stars with the mouse. I'm getting stuck on trying to create a TriangleSelector, because the function (createTriangleSelector) wants a mesh, and I am not loading my scene from a mesh. If I pass it 0 for the mesh pointer it returns 0.

So I have two questions:
1) How can I create a triangle selector without associating a mesh?
2) Will this approach even work?
laforced
Posts: 39
Joined: Tue Feb 01, 2005 5:07 am
Location: South Carolina,USA
Contact:

Post by laforced »

What are your stars composed of?
Are you just displaying a bitmap with images that look like stars?
Triangle selector requires some sort of mesh, meshes are made
up of triangles. If you are using just a bitmap, you could use the
coordinates of the star images in the bitmap and reference those
coordinates as the stars.
If you're not making GREAT games
you belong in an institute!
The Game Institute.
www.gameinstitute.com
Guest

Post by Guest »

Yes, my stars are billboards. I load their positions dynamically based on an XML file. Here's a screenshot:

Image

I would very much like to use the coordinates to build a triangle selector, but I can't figure out how to define that in irrlicht. Is there some way to make define a mesh on the fly without loading it from a file?
Guest

Post by Guest »

What method are you using to create the billboard?
Are you using a quad to contain the image or are you using
a point sprite? Are the billboards assigned to a node?
rincewind
Posts: 35
Joined: Thu Mar 25, 2004 5:28 pm
Location: Germany --> Bonn

Post by rincewind »

why do you need a triangleselector? you could use ISceneCollisionManager::getSceneNodeFromScreenCoordinatesBB()
for mousepicking, which uses boundingboxes to select the scenenode.

greetings, rincewind
Ablaze
Posts: 4
Joined: Sat Jan 22, 2005 9:18 pm

Post by Ablaze »

I'm not sure what a quad or a point sprite is, but yes.. each star image is assigned to it's own node, and there is a node for the center of the galaxy so I can rotate the whole thing if I need to.

I didn't realize that would work if there wasn't a selecter, rincewind. I'll try that, thanks.
Time is the best teacher, unfortunately it kills all it's students.
Post Reply