Total members 11383 |It is currently Thu Nov 27, 2014 11:26 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R

All times are UTC [ DST ]



  J2me some rules
Sat Apr 28, 2007 9:44 am 

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 .
Attachment:
File comment: Up
up.JPG
up.JPG [ 3.13 KiB | Viewed 1583 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.

_________________
Please recommend / share my post if you found it helpful.


Author:
Mastermind
User avatar Posts: 2694
Have thanks: 73 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : J2me some rules
 Implementation of association rules     -  
 CODEMILES : RULES AND REGULATIONS     -  
 J2ME     -  
 What is the J2ME!!!!     -  
 J2ME Datagrid     -  
 bluetooth in j2me     -  
 j2me io.File     -  
 j2me Red Snake 3D     -  
 looking for J2ME opportunities     -  
 j2me encryption     -  

All times are UTC [ DST ]









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team