IonicWind Software

IWBasic => 3D Programming => Topic started by: ZeroDog on August 28, 2009, 04:04:06 PM

Title: SetShapeColor?
Post by: ZeroDog on August 28, 2009, 04:04:06 PM
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?
Title: Re: SetShapeColor?
Post by: RG on August 30, 2009, 01:53:44 PM
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 (http://www.ionicwind.com/forums/index.php/topic,2000.0.html)

Rich
Title: Re: SetShapeColor?
Post by: ZeroDog on August 30, 2009, 03:33:39 PM
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)