jPCT-AE 3D engine Wrapper

gezueb

Active Member
Licensed User
Hi, I try to merge loaded objects into a single object which then can be translated and turned, but I cannot figure out how to do it. Model3.megreobjects (Model1, Model2) seems to be okay, but when I try to add the merged model to the world, it throws an exception. Thanks for help, Georg
 

sn_nn

Member
Licensed User
The problem about "JpctPolyline" is that you can't create array of SimpleVector with the Project Wrapper of Alhowiriny


So one fix:

1°) With eclipse, Add this method in the class "JPolyline.java" in the Project Wrapper Source of Alhowiriny :

public SimpleVector[] essai(int dimension) {
SimpleVector[] ess=new SimpleVector[dimension];
return ess;
}


2°) With B4A, Use Pl_Line.essai(X) for create an array of X SimpleVector

Dim Pl_Line As JpctPolyline
Dim Pl_obj() As Object
Dim Pl_Tab(100) As JpctSimpleVector

Pl_obj=Pl_Line.essai(Pl_Tab.Length)
For i=0 To Pl_obj.Length-1
...
Pl_obj(i)=Pl_Tab(i)
Next
Pl_Line.update(Pl_obj)


3°) Good luck (it's not easy but it's work well)

Files -jar and -xml was changed, as recommended
Next code was used in project:
Polyline in JPCT-AE Wrapper:
Dim i As Int
Dim LineColor As JpctRGBColor
   LineColor.Initialize2(50,100,250)
Dim Pl_Line As JpctPolyline
Dim Pl_obj() As Object
Dim Pl_Tab(100) As JpctSimpleVector
Pl_obj=Pl_Line.essai(Pl_Tab.Length)
For i=0 To Pl_obj.Length-1
   Pl_Tab(i).Initialize
   Pl_Tab(i).create3(i*0.5,-0.5+i*0.2,-0.5+i*0.3)
   Pl_obj(i)=Pl_Tab(i)
Next
Pl_Line.Initialize(Pl_obj,LineColor)
Pl_Line.update(Pl_obj)
Pl_Line.Width=5
Pl_Line.Percentage=1
World.addPolyline(Pl_Line)
No errors, but also not any polyline was drawed...😕
 
Top