March 28, 2024, 12:28:54 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


SetShapeColor?

Started by ZeroDog, August 28, 2009, 04:04:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ZeroDog

CBasic has:
D3DCOMMAND shape,@SETSHAPECOLOR,.5, .3, .4

What would be the the EBasic  equivalent?  Do I have to use the SetMaterial method, or is there another way?

RG

August 30, 2009, 01:53:44 PM #1 Last Edit: August 30, 2009, 01:56:46 PM by RG
If you build the mesh, you can set vertex colors as you build it: #<VERTEX1TEXTURE>pVB[index+i].diffuseColor = RGBA(255,255,255,1) and use sphere.UseVertexColor(TRUE). (I think this is right).

Vasemaker uses the material approach http://www.ionicwind.com/forums/index.php/topic,2000.0.html

Rich

ZeroDog

Im using the primitives already in the object (createSphere) so I guess I could either calculate how many vertex's are in the mesh and apply a color to each vertex, or use the setmaterial method... the setmaterial method seems like it would be easier, and more portable.  Thanks  8)