Total members 11890 |It is currently Thu Apr 25, 2024 8:50 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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 4723 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.



_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


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

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



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com