Page 1 of 1

Two things

Posted: Sun Dec 23, 2007 5:16 am
by pinkman
[ First : I searched for this first one.. ]
How do I create custom meshes?(I assume these are called meshes)
in OpenGL would be done glBegin(); - glEnd();(assume you can fill in the rest)
Any information?

[ Second ]
I was thinking of also making a custom camera, the camera stares constantly at an object, then is pulled along to the character, by an invisible string, sound like a good idea?

Posted: Sun Dec 23, 2007 7:38 am
by rooly
search for "3rd person camera" for your second question

Posted: Sun Dec 23, 2007 10:35 am
by hybrid
Answer for the first: Simply create a new SMesh and SMeshBuffer, fill the latter with vertex information, add it to the first one, create a scene node from it, done.

Posted: Sun Dec 23, 2007 1:02 pm
by shogun
And the answer to you third question is: Yes, it's always better to give postings descriptive names when seeking for help.

Posted: Sun Dec 23, 2007 11:47 pm
by pinkman
Mesh m = new Mesh();
MeshBuffer mb = new MeshBuffer(VertexType.Standard);
Vector3D vec;
vec = new Vector3D(0, 0, 0);
mb.SetVertex(0, new Vertex3D(vec, vec.Normalize(), Color.White, new Vector2D(0, 0)));
vec = new Vector3D(1, 0, 0);
mb.SetVertex(0, new Vertex3D(vec, vec.Normalize(), Color.White, new Vector2D(1, 0)));
vec = new Vector3D(1, 0, 1);
mb.SetVertex(0, new Vertex3D(vec, vec.Normalize(), Color.White, new Vector2D(1, 1)));
vec = new Vector3D(0, 0, 1);
mb.SetVertex(0, new Vertex3D(vec, vec.Normalize(), Color.White, new Vector2D(0, 1)));
m.AddMeshBuffer(mb);
SceneNode me = device.SceneManager.AddMeshSceneNode(m, null, -1);
me.Position = new Vector3D(0, -1, 1);

Is my code.. doesnt seem to display anything though..
(btw am using C# Irrlicht, as you can see)

Posted: Mon Dec 24, 2007 12:58 am
by arras
Look here for some inspiration:
Add your own cube node by rogerborg
Somebody might made it sticky or even part of the tutorials, I keep posting this link quit often :)