Well, actually, I changed it to the following, so that it draws a triangle:

(inside the Frame() function):

  csSimpleRenderMesh rendMesh;
  rendMesh.object2world.Identity();

  csVector3 verts[2];
  verts[0].Set (0, 0, 0);
  verts[1].Set (10.0, 0, 0);
  verts[2].Set(0, 10.0, 0);

  csVector4 cols[2];
  cols[0].Set(1.0, 0.0, 0.0, 1.0);
  cols[1].Set(1.0, 0.0, 0.0, 1.0);
  cols[2].Set(1.0, 0.0, 0.0, 1.0);

  rendMesh.vertices = verts;
  rendMesh.vertexCount = 3;
  rendMesh.colors = cols;

  rendMesh.meshtype = CS_MESHTYPE_TRIANGLES;
  csAlphaMode alf;
  alf.alphaType = alf.alphaSmooth;
  alf.autoAlphaMode = false;
  rendMesh.alphaType = alf;
 
  g3d->BeginDraw(engine->GetBeginDrawFlags() | CSDRAW_3DGRAPHICS);
  g3d->DrawSimpleMesh(rendMesh, 0);
  g3d->FinishDraw();


My camera (view transform) is set up as follows:
  view->GetCamera ()->GetTransform ().SetOrigin (csVector3 (0, 0, -10));
  view->GetCamera ()->GetTransform ().LookAt (csVector3(0, 0, 0), 
csVector3(0, 1, 0));


Thanks for any help you can give.

~Scott

infinity wrote:
> it says "meshtype lines" and only has 2 verts... what does that mean? That
> it draws just an edge like blender's viewport can?
>
>
>
> ----- Original Message -----
> From: "Scott Johnson" <[EMAIL PROTECTED]>
> To: "CS developers and users list" <crystal-main@lists.sourceforge.net>
> Sent: Saturday, June 14, 2008 5:31 PM
> Subject: Re: [CsMain] Use of csTriangleMesh
>
>
>   
>> Amir:
>>
>> I don't seem to be getting anything on the screen with this code. I
>> placed it in my Frame() function, in between a call to:
>>
>> g3d->BeginDraw(engine->GetBeginDrawFlags() | CSDRAW_3DGRAPHICS);
>>
>> and
>>
>> g3d->FinishDraw();
>>
>> Is there anything else I need to do?
>>
>> Thanks,
>>
>> ~Scott
>>
>>
>> Amir Taaki wrote:
>>     
>>> Don't know about that. But you can use csSimpleRenderMesh instead
>>>
>>>   csSimpleRenderMesh mesh;
>>>   mesh.object2world.Identity();
>>>
>>>   csVector3 verts[2];
>>>   verts[0].Set (-1, 0, -1);
>>>   verts[1].Set (1, 0, 1);
>>>
>>>   mesh.vertices = verts;
>>>   mesh.vertexCount = 2;
>>>   mesh.meshtype = CS_MESHTYPE_LINES;
>>>   g3d->DrawSimpleMesh (mesh, 0);
>>>
>>> For example.
>>>
>>> On Thursday 12 June 2008 04:57:58 Scott Johnson wrote:
>>>
>>>       
>>>> Hi Everyone:
>>>>
>>>> I'm working with csTriangleMeshes, and I am just trying to find the
>>>> correct way to draw a mesh once it's been developed.  So, I was just
>>>> wondering if there is a simple snippet of code someone might be able to
>>>> give me that will draw a csTriangleMesh.
>>>>
>>>> Thanks,
>>>>
>>>> ~Scott
>>>>
>>>>
>>>>         
>>> -------------------------------------------------------------------------
>>>       
>>>> Check out the new SourceForge.net Marketplace.
>>>> It's the best place to buy or sell services for
>>>> just about anything Open Source.
>>>> http://sourceforge.net/services/buy/index.php
>>>> _______________________________________________
>>>> Crystal-main mailing list
>>>> Crystal-main@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/crystal-main
>>>> Unsubscribe:
>>>> mailto:[EMAIL PROTECTED]
>>>>
>>>>         
>>>
>>>       
>> -------------------------------------------------------------------------
>>     
>>> Check out the new SourceForge.net Marketplace.
>>> It's the best place to buy or sell services for
>>> just about anything Open Source.
>>> http://sourceforge.net/services/buy/index.php
>>> _______________________________________________
>>> Crystal-main mailing list
>>> Crystal-main@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/crystal-main
>>> Unsubscribe:
>>>       
> mailto:[EMAIL PROTECTED]
>   
>> -------------------------------------------------------------------------
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://sourceforge.net/services/buy/index.php
>> _______________________________________________
>> Crystal-main mailing list
>> Crystal-main@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/crystal-main
>> Unsubscribe:
>>     
> mailto:[EMAIL PROTECTED]
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Crystal-main mailing list
> Crystal-main@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/crystal-main
> Unsubscribe: mailto:[EMAIL PROTECTED]
>   

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Crystal-main mailing list
Crystal-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]

Reply via email to