In j2me 3D package the Camera is by default looking to negative z axis.
When u define an square vertices points take care of the order.
what u will do is drawing triangles strips.
You may ask why in j2me they made triangles strips?
the answer is : Because this method make rendering(drawing) process more faster.
Example : (square) square contain two triangles.
If i assume that the camera position is (0,0,0) and it is facing -z axis.
1. Order to up :
(0,0,-10),(0,10,-10),(-10,0,-10),( -10,10,-10)
this vertices's to draw square Directly in front of camera .
- Up
- up.JPG (3.13 KiB) Viewed 4895 times
2. Order to down
(0,10,-10),(0,0,-10),(-10,10,-10),( -10,0,-10)
you will not see nothing after you run your application we using this order because the angle between the camera normal and square normal is larger than 90' .
You can rotate the camera about the y-axis using a Transform class.
for example rotate the camera about y-axis 180'. after that u can see the square because after that the angle between the camera normal and square normal will be smaller than 90'
if u want to add colors to your square you have to add light object first.
the light object need the normal of your surface.
Otherwise the square will appears in black color.