SetFlatSet GouraudSetLambert


SetFlat/Set Gouraud/SetLambert

SetFlat and SetGouraud enable or disable the flat or Gouraud rendering modes.

 object.SetFlat(On/Off) 

or

 object.SetGouraud(On/Off) 

Notes

Objects in Jamagic can have Gouraud or flat shading (a third type is Lambert shading, which is nearly identical to Gouraud).

Flat shading is not very realistic. It is uniformly bright over the entire object s surface.

Gouraud shading gives a much more realistic and interesting effect in that the brightness of the surface is not uniform.

Sample Code

 oworld = New World(); ocamera = New Camera(oworld); sphere = oworld.CreateSphere(50,50,50,25,25); sphere.SetPosition(0,200,0); mats = New Material(oworld,,RED,"mats"); sphere.SetGouraud(); sphere.ReplaceMaterial(mats); plane = oworld.CreatePlane(600,600); Matplane = New Material(oworld, ,GREEN, "Matplane"); matplane.SetFlat; plane.ReplaceMaterial(matplane); plane.SetAngle(-Pi/2,0,0); plane.SetStatic(); oworld.Optimize(ocamera); ocamera.MoveBack(1200); ocamera.MoveUp(200); sphere.Walk(); sphere.SetShadowMode(Object.SHADOW_MODE_TRUE); sphere.EnableShadow(); //loop While(TRUE); 



Elementary Game Programming and Simulators Using Jamagic
Elementary Game Programming & Simulations Using Jamagic (Charles River Media Game Development)
ISBN: 1584502614
EAN: 2147483647
Year: 2002
Pages: 105
Authors: Sergio Perez

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net