forked from chetanshetty/XamiAndAR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomObject2.cs
68 lines (45 loc) · 1.57 KB
/
CustomObject2.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Collections.Generic;
using System.Text;
using Java.Lang;
using Android.Hardware;
using Java.IO;
using Javax.Microedition.Khronos.Opengles;
using Java.Nio;
using Android.Opengl;
using XamiAndAR;
using XamiAndAR.Interfaces;
using XamiAndAR.Exceptions;
using XamiAndAR.Pub;
using XamiAndAR.Utilities;
using XamiAndAR.AndOpenGLCam;
namespace XamiAndARApp
{
public class CustomObject2 : ARObject
{
private Cube mCube;
public CustomObject2(string name, string patternName,
double markerWidth, double[] markerCenter)
: base(name, patternName, markerWidth, markerCenter) {
mCube = new Cube();
}
public override void Draw(IGL10 gl) {
base.Draw(gl);
gl.GlClear(GL10.GlColorBufferBit | GL10.GlDepthBufferBit);
gl.GlLoadIdentity();
gl.GlTranslatef(0.0f, 0.0f, 12.0f);
//gl.GlRotatef(mCubeRotation, 1.0f, 1.0f, 1.0f);
gl.GlViewport(0, 0, Convert.ToInt32(MarkerWidth), Convert.ToInt32(MarkerWidth));
gl.GlMatrixMode(GL10.GlProjection);
gl.GlLoadIdentity();
GLU.GluPerspective(gl, 45.0f, (float)Convert.ToInt32(MarkerWidth) / (float)Convert.ToInt32(MarkerWidth), 0.1f, 100.0f);
gl.GlViewport(0, 0, Convert.ToInt32(MarkerWidth), Convert.ToInt32(MarkerWidth));
gl.GlMatrixMode(GL10.GlModelview);
gl.GlLoadIdentity();
mCube.draw(gl);
}
public override void Init(IGL10 p0)
{
}
}
}