Recent Posts

Pages: 1 ... 7 8 [9] 10
81
News / Re: Maintainability
« Last post by EgonOlsen on November 08, 2022, 12:20:06 pm »
The library is still maintained, but no new major features will be added to it in the foreseeable future. Therefor, releases contain mainly bug fixes and after all these years, there aren't many bugs to fix anymore. That's the update frequency decreased.
82
News / Maintainability
« Last post by GMas on November 08, 2022, 11:49:56 am »
Stupid question for your guys. Why this lib have less and less releases ? Is it less and less well-maintained  :-\ ?
83
News / Forum upgraded to 2.0.19
« Last post by EgonOlsen on September 09, 2022, 01:49:45 pm »
Because...why not!?
84
Support / Re: 3Dto2D
« Last post by EgonOlsen on August 09, 2022, 08:57:24 am »
Sorry for not replying sooner, I was on holiday. But then again, I don't have much to add to what AeroShark333 already said. It highly depends on your application how to obtain the point in 3D.
85
Support / Re: 3Dto2D
« Last post by MichaelJPCT on July 25, 2022, 07:19:09 am »
In theory, this information is already somewhere in jpct-ae, since visible points are projected onto the screen, and so on with the calculation of the distance to the points .

it is calculated in GPU. maybe you can get that info by reading depth buffer. but even so, the read operation costs a lot of time, no good for real time application.
86
Support / Re: 3Dto2D
« Last post by aleks1283 on July 25, 2022, 12:01:30 am »
Thanks
87
Support / Re: 3Dto2D
« Last post by AeroShark333 on July 24, 2022, 07:08:03 pm »
I see two possibilities:
1.
I'd first loop over all Object3D's in the world.
Then see which of these Object3D's are in the camera's FOV.
(Easiest way would be to do a dot product with the camera direction and the vector connecting the camera to each Object3D; then let's say > 0 falls in the camera view and < 0 is behind the camera's view.)

Then next, using the Object3D's in the camera's view, you'll be using polygon manager. https://www.jpct.net/jpct-ae/doc/com/threed/jpct/PolygonManager.html
You'll have something like this:
Code: [Select]
final Object3D obj = ...;
PolygonManager objPM = obj.getPolygonManager();
for(int id = 0; id < objPM.getMaxPolygonID(); id++){
if(objPM.getTransformedNormal(id).y > 0){
// ^Check if normal of polygon points up...
// Change if this doesn't work
SimpleVector v1 = objPM.getTransformedVertex(id, 0);
SimpleVector v2 = objPM.getTransformedVertex(id, 1);
SimpleVector v3 = objPM.getTransformedVertex(id, 2);
float maxHeight = Math.max(Math.max(v1.y, v2.y), v3.y);
// Do whatever with the max height of this polygon face
}
}
I sort of assumed here that the camera is looking down in the y-axis...

2. Shoot rays for every pixel on the screen and see with which Object3D and polygon face it interacts with. Then use the PolygonManager again to get the distance to that polygon (by averaging vertices or something)...
Make sure the algorithm is RAY:
https://www.jpct.net/jpct-ae/doc/com/threed/jpct/CollisionEvent.html
Maybe the code in reply #19 can help you with ray-polygon intersection:
https://www.jpct.net/forum2/index.php/topic,4821.msg32989.html#msg32989
It's up to you whether you want the ray to be from the camera's origin or parallel to the camera's direction...
To get the 3D position of the screen plane, I think you should use "reproject2D3DWS" in Interact2D. Then you can shoot a ray with vector "normalize((3D position of screen plane) - (camera position))"...
For ray-polygon picking, I think this might be useful: https://www.jpct.net/wiki/index.php/Picking and https://www.jpct.net/doc/com/threed/jpct/World.html#calcMinDistance(com.threed.jpct.SimpleVector,%20com.threed.jpct.SimpleVector,%20float)

Sorry for this messy explanation; typing on phone isn't ideal...
88
Support / Re: 3Dto2D
« Last post by aleks1283 on July 24, 2022, 11:33:27 am »
Egon where are you? How to get this information??? :) :) :)
89
Support / Re: 3Dto2D
« Last post by aleks1283 on July 24, 2022, 09:07:04 am »
In theory, this information is already somewhere in jpct-ae, since visible points are projected onto the screen, and so on with the calculation of the distance to the points .
90
Support / Re: 3Dto2D
« Last post by aleks1283 on July 24, 2022, 08:56:33 am »
How first find the local position of each visible point on 3D?
Pages: 1 ... 7 8 [9] 10