Two things

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
pinkman
Posts: 25
Joined: Sun Dec 10, 2006 3:04 am

Two things

Post 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?
rooly
Posts: 224
Joined: Tue Oct 25, 2005 4:32 pm
Location: Louisiana, USA, backwater country
Contact:

Post by rooly »

search for "3rd person camera" for your second question
When banks compete, you win.
When ISPs compete, you win.
When electronics retailers compete, you win.
When governments compete...you get drafted.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
shogun
Posts: 162
Joined: Wed Sep 05, 2007 11:02 am
Location: inside

Post by shogun »

And the answer to you third question is: Yes, it's always better to give postings descriptive names when seeking for help.
pinkman
Posts: 25
Joined: Sun Dec 10, 2006 3:04 am

Post 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)
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post 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 :)
Post Reply