<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[GMan's Mods & Stuff — Can't AddVertex (BB3D Irrlicht)]]></title>
		<link>https://gprogs.com/viewtopic.php?id=469</link>
		<atom:link href="https://gprogs.com/extern.php?action=feed&amp;tid=469&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Can't AddVertex (BB3D Irrlicht).]]></description>
		<lastBuildDate>Sun, 06 Jan 2013 20:40:31 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Can't AddVertex (BB3D Irrlicht)]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1749#p1749</link>
			<description><![CDATA[<p>hello together,</p><p>my problem is i want create a triangle like you can see in the following code. But i get an error every time in the surface.bmx. What should i do????</p><p>&nbsp; </p><div class="codebox"><pre><code>SuperStrict
Import irrlicht.b3d

ib3d_Graphics3D(800, 600, 32, 0, True, True, EDT_DIRECT3D8)



Global cam:CAMERA = ib3d_CreateCamera()
ib3d_PositionEntity(cam, 0, 0, -10)

Global light1:LIGHT = ib3d_CreateLight()
ib3d_PositionEntity(light1, 0, 0, 0)
 &#039;SMeshBuffer() 

Global cube:MESH = ib3d_CreateMesh()
Global surf:SURFACE = ib3d_CreateSurface(cube, SF_NORMAL)    
Global v1:Int = ib3d_AddVertex(surf, 0,0 , 0)
Global v2:Int = ib3d_AddVertex(surf, 1, -1, 0)
Global v3:Int = ib3d_AddVertex(surf, -1, -1, 0)
ib3d_AddTriangle(surf, v1, v2, v3)
ib3d_UpdateNormals(cube)

While Not ib3d_KeyDown(KEY_ESCAPE)


    ib3d_UpdateWorld
    ib3d_RenderWorld
WEnd</code></pre></div><p>Surface.bmx<br />The error show that something in this wrong in this Method:</p><p>&nbsp; </p><div class="codebox"><pre><code>    &#039; TODO: dont think this is working right.  need to examine source of addTestSceneNode().
    Method addVertex:Int(x:Float,y:Float,z:Float,nx:Float=0,ny:Float=0,nz:Float=0,u:Float=0,v:Float=0)
        If Not _mbuf Or Not _mbuf.isValid() Then RuntimeError &quot;Surface meshbuffer is invalid&quot;
Rem
        Local vert:S3DVertex=S3DVertexDefault.createFromVals(x,y,z,nx,ny,nz,SColor.createFromVals(255,255,255,255),u,v)
        Local vert_array:S3DVertex[1] = vert
        &#039;DebugLog(&quot;before: &quot;+_mbuf.getVertices().size())
        _mbuf.getVertices().push_back(vert)
        &#039;DebugLog(&quot;after: &quot;+_mbuf.getVertices().size())
EndRem
        RuntimeError &quot;Not Implemented&quot;
        Return _mbuf.getVertexCount()-1
    EndMethod</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Mangoo)]]></author>
			<pubDate>Sun, 06 Jan 2013 20:40:31 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1749#p1749</guid>
		</item>
	</channel>
</rss>
