Mesh edges?
Mesh edges?
I have a mesh in the shape of a car, and I need to find out how "big" this mesh is, where its front is so that I can draw a missile infront of it when fired and also put lights infront of the car. How do I do it? How can I find the front of the car? and its size?
-
- Posts: 360
- Joined: Tue Feb 10, 2004 2:20 am
- Location: Lubbock, TX
Wahoooo lots of questions there. to find the direction the car is pointed you can use the getRotation funtion when you know this you can find out where you need to put the missile. and the lights. You would want to put the lights on the car at the begining of the scene then make them a child of the car so they would stay with the car and then toggle them on an off as needed.
Well.... the rotation I have... I need to find out how big the car is and in that way calculate where the lights should be placed... if I set the light (and the missiles) at the default (0,0,0) then it will be placed in the middle of the carmesh... so... what I'm after are the "box" around the car...
What I would do is open up your car mesh inside your modeller and find the 3D position that you want the lights to be. Then, create the effect and add it as a child of the car mesh. You will then be able to enter the position you found inside your modeller and it will be correct.
You will also not need to worry about rotation as whatever rotation the car is set to will be translated to the car light or whatever effect you plan to have.
You will also not need to worry about rotation as whatever rotation the car is set to will be translated to the car light or whatever effect you plan to have.
-
- Posts: 360
- Joined: Tue Feb 10, 2004 2:20 am
- Location: Lubbock, TX
-
- Posts: 360
- Joined: Tue Feb 10, 2004 2:20 am
- Location: Lubbock, TX
Well of course, how is Irrlicht supposed to know where the lights on a car should go without the programmers guidence? You could simple have that data stored and then read in when a new model is loaded.Felipe wrote:but what if he has different car models? He'd have to pre-locate the headlights for every model.
If they want to add their own meshes then they will have to define where abouts they want the lights exactly the same as they would have to define where the wheels would go on the car. Unless you wanted to model the car around a set of lights and wheels which not be a very intelligent solution. It doesn't need to be hardcoded but it DOES need to be defined.
-
- Posts: 360
- Joined: Tue Feb 10, 2004 2:20 am
- Location: Lubbock, TX
NO its not the easiest way to do it. It is the only way. The location of the lights HAVE to be defined unless they are their own model. To Irrlicht the model is a set of trinagles nothing more nothing less (Well there are some normals and some other stuff but who cares).Felipe wrote:I guess that's the easiest way to do it. Though, to me it feels like I'm doing something for the code that it could be doing by itself. Sorta like if a math game were to ask you the answer to a problem so it could tell you if your kid's answer was right or not.
-
- Posts: 360
- Joined: Tue Feb 10, 2004 2:20 am
- Location: Lubbock, TX
Sorrey for that I am really not feeling well and I haven't slept in two days. Some of you may have noticed I have been on the fourm for two days straight and have moved from 10th to 6th in total number of posts in just three days
I just got back from the doctor and he says that I have really bad asma even though I have never had it before. My chest is hurting and I can barely breath. I am 22 and I get #@@(#(!(!!! asma what the @#$!!!!
Anyway sorry just a little pissed.
I just got back from the doctor and he says that I have really bad asma even though I have never had it before. My chest is hurting and I can barely breath. I am 22 and I get #@@(#(!(!!! asma what the @#$!!!!
Anyway sorry just a little pissed.