Skip to content

Instantly share code, notes, and snippets.

View rtroe's full-sized avatar

Rob Tom Roe rtroe

View GitHub Profile
public Matrix MatrixTransform
{
set
{
if (Parameters["MatrixTransform"] != null)
Parameters["MatrixTransform"].SetValue(value);
}
}
namespace Virtex.Lib.Vrtc.Graphics
{
public interface vxPostProcessorInterface
{
void SetResoultion();
void LoadContent();
void Apply();
}
// Reset the Bounding Sphere's Center Position
BoundingShape.Center = Vector3.Transform(ModelCenter, World);
// Now Check if this entity is even in view of the camera
IsInCameraViewFrustum = Camera.IsInViewFrustrum(BoundingShape);
public bool IsInViewFrustrum(BoundingSphere boundingSphere)
{
return BoundingFrustum.Intersects(boundingSphere);
}
public static BoundingSphere GetModelBoundingSphere(Model model)
{
// Initialize minimum and maximum corners of the bounding box to max and min values
Vector3 min = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue);
Vector3 max = new Vector3(float.MinValue, float.MinValue, float.MinValue);
// For each mesh of the model
foreach (ModelMesh mesh in model.Meshes)
{
foreach (ModelMeshPart meshPart in mesh.MeshParts)
EffectParameterCollection parameters = xEngine.Assets.PostProcessShaders.CartoonEdgeDetection.Parameters;
Vector2 resolution = new Vector2(RT_MainScene.Width,
RT_MainScene.Height);
// Pass in the current screen resolution.
parameters["ScreenResolution"].SetValue(resolution);
parameters["NormalTexture"].SetValue(RT_NormalMap);
parameters["DepthTexture"].SetValue(RT_DepthMap);
void wxOCEWindow::CreateBottle()
{
TopoDS_Shape aBottle=MakeBottle(150,210,90);
Handle(AIS_Shape) AISBottle=new AIS_Shape(aBottle);
myContext->SetMaterial(AISBottle,Graphic3d_NOM_GOLD);
myContext->SetDisplayMode(AISBottle,1,Standard_False);
myContext->Display(AISBottle, Standard_False);
DoZoomFit();
}
void wxOCEWindow::OnIdle(wxIdleEvent& event)
{
mView->MustBeResized(); // if the user changes the window size
mView->Redraw();
}
void wxOCEWindow::OnSize(wxSizeEvent& event)
{
int width, height;
class wxOCEWindow: public wxScrolledWindow
{
public:
wxOCEWindow(wxWindow *parent, const wxPoint& pos, const wxSize& size, long style);
...
TCollection_ExtendedString a3DName ("Visu3D");
//Create the Global wxPanel too hold the wxOCE Control
//////////////////////////// VARIABLES /////////////////////////////
//The OCE Window
Handle(Xw_Window) wind;
//The Panel which holds the OCE Window
wxPanel* ctrl ;
//Used for connecting too the Graphics Card