Hi,
I am very new to 3d space and Irrlicht engine.
I have a car image which is in 3ds format and can able to load through Irrlicht engine.
My main task is to select different items of car like doors, tyres, lights etc using mouse. I have implemented EventReceiver also but unable to select any item of the car.
Please guide me how i can select items from 3ds image using Irrlicht engine.
Thx
Babu
3d Car with Selectable Items
-
hybrid
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: 3d Car with Selectable Items
In general you simply can't do this. The 3ds loader will usually re-group vertices based on material definitions, and hence you can easily lose all the previously defined structures. But even if you keep those groups (e.g. by defining different materials for each one) you don't have an easy access to them. The loader is allowed to re-arrange mesh buffers, which makes it hard for proper selection, at least if you want to assign those groups some externally saved properties. What you can do in this case is just to move around those groups, and assign different material properties. You simply access the mesh buffers of the mesh.
A better way would be to use a simple skeleton (with .b3d or .x format for example) and access the named bones to select the groups. These are always kept during loading, and due to the naming you can even save external properties. Maybe describe a littel more the setting in which you are working with those groups so we can help better.
A better way would be to use a simple skeleton (with .b3d or .x format for example) and access the named bones to select the groups. These are always kept during loading, and due to the naming you can even save external properties. Maybe describe a littel more the setting in which you are working with those groups so we can help better.
Re: 3d Car with Selectable Items
Maybe you want separate model for each item. Doors, tires, shell, lights, everything is separate 3ds file. Then its easy for selection (just see picking tutorial).
Re: 3d Car with Selectable Items
As a first step load the 3ds model in irrlicht and turn on some debug data:
What you would see is a number of boxes corresponding to different parts of the model or, in terms of irrlicht, different mesh buffers making up the overall model mesh.
The overall steps are as follows:
1. find collision triangle using scene::ISceneCollisionManager
2. transform the 3 vertices (which are in world) of the triangle into local space of the model
3. search the vertices through different mesh buffers
4. if step 3. is ok, highlight the bounding box of the found mesh buffer by e.g. drawing 3d lines
Caution: you will have a long journey to the goal!
Regards
smso
Code: Select all
model->setDebugDataVisible(scene::EDS_BBOX_ALL);The overall steps are as follows:
1. find collision triangle using scene::ISceneCollisionManager
2. transform the 3 vertices (which are in world) of the triangle into local space of the model
3. search the vertices through different mesh buffers
4. if step 3. is ok, highlight the bounding box of the found mesh buffer by e.g. drawing 3d lines
Caution: you will have a long journey to the goal!
Regards
smso
-
suresh4irrlicht
- Posts: 3
- Joined: Mon Feb 06, 2012 7:12 am
Re: 3d Car with Selectable Items
Thank you guys for replying.
Still i am not clear how to go with my requirement. Let me explore more and can post exact requirement.
Thx
Suresh
Still i am not clear how to go with my requirement. Let me explore more and can post exact requirement.
Thx
Suresh