Parametrized 3D object

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
Cyberdrill
Posts: 18
Joined: Wed Feb 27, 2008 2:32 pm
Location: Russia, Moscow

Parametrized 3D object

Post by Cyberdrill »

How correctly create parametrzied 3D object in Irrlicht, for example parallelepiped with properties Width, Lenght, Height, that can be changed from code and 3D model chenges accordingly.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I'm not sure i understand what you're after...

Do you want a pipe model which can be scaled within your code?

That's simple enough, load a model of a pipe and then use node->setScale(vector3df(x,y,z)) to scale it to the desired size.

If that's not what you meant can you try to explain better?
Image Image Image
Cyberdrill
Posts: 18
Joined: Wed Feb 27, 2008 2:32 pm
Location: Russia, Moscow

Post by Cyberdrill »

No, scale is not what i need :(

I have more complex object than pipe, and i want to know, how can i control modification of object in Irrlicht. I think that Custom Scene Node (Tutorial 3) is what i need, but may be there is easer way to control 3D model...

In other words :) ...

how can i change internal pipe size or pipe wall thickness... I think must be a way to create object "Pipe" with this properties and somehow connect it to 3D medel... Scale is wrong way i think...
[/img]
Cyberdrill
Posts: 18
Joined: Wed Feb 27, 2008 2:32 pm
Location: Russia, Moscow

Post by Cyberdrill »

And one more question...

Is there any way to create more complex than cube 3D model in Irrlicht without using ready 3D model from some editor... It could also solve my task...
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Ok so you want to be able to control things like the thickness of the pipe's 'walls' right?

Yeah sounds more complicated than scaling....

I'm not sure how you'd go about doing it, i guess you'd need to have each seperate part of the model that you'd want to affect in a different mesh buffer and then scale the individual mesh buffers to get that effect....
Image Image Image
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Cyberdrill wrote:And one more question...

Is there any way to create more complex than cube 3D model in Irrlicht without using ready 3D model from some editor... It could also solve my task...
Only really with the custom scene node or putting verts into a mesh buffer.
Image Image Image
Cyberdrill
Posts: 18
Joined: Wed Feb 27, 2008 2:32 pm
Location: Russia, Moscow

Post by Cyberdrill »

thanks! I'll try custom scene node then... By the way, is it wise to use Irrlicht for my CAD application (it calculates equipment and visualize it in 3D), or Managed DirectX is better for my task?...
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I'm not particularly sure what MDX is, seems to be a more easily usable version of DX right? So i guess in a way it's like irrlicht in the way that irrlicht abstracts away from DX and OGL calls.

But i would imagine that irrlicht would probably still be the easier of the two to use, though i've not used MDX so can't accurately comment on it!
Image Image Image
Cyberdrill
Posts: 18
Joined: Wed Feb 27, 2008 2:32 pm
Location: Russia, Moscow

Post by Cyberdrill »

Irrlicht is very usefull for game developement, but for CAD i can't find any tutorials, examples or ready projects... I continue search for Irrlicht advantages in CAD developement :)

P.S. Managed DX is DX with very convinient API, fully integrated with .NET (and I'm .NET developer)... It also has cameras like Irrlicht and it works with 3D models and so on...
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You won't need a custom scene node if you just want to use custom meshes. Then it's enough to create an SMesh manually, fill the meshbuffers, and add it to a mesh scene node. When you want to change the mesh you simple getMesh() it and access the meshbuffers.
Custom scene node is necessary for special render techniques, or when custom meshes have to be serialized (see the Sphere scene node)
Cyberdrill
Posts: 18
Joined: Wed Feb 27, 2008 2:32 pm
Location: Russia, Moscow

Post by Cyberdrill »

Thanks!
And how should create custom complex object? Or, for examle, cone with meshes?
Is it real to create surfaces with meshes by using mathematic functions that describes this surfaces?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You should check the CGeometryCreator for this. It contains the sphere generation method, which does a pretty similar job. The basics are to create an SMesh and an SMeshBuffer, add the buffer to the mesh and fill it with S3DVertex elements. Then you'll also need indices to choose the vertices which define a face of the mesh. Finally set up the material and recalculate the bounding boxes.
Post Reply