Dear Pv3D gurus,
All this while i have been trying to make a 2d editor which will help me to draw maps by just drawing lines around in the 2d screen for the walls and other library items which has an equivalent 3d representation for a FPS based game. Then i take those line starting and end point values and construct them as 3D walls using rectangles/planes by deciphering the x,y,z and rotational values mathematically( just by applying 2d y value as z value in 3d. The height of the wall is arbitrarily chosen. The rotation value is calculated using Math.atan2(lineend.y - linestart.y,lineend.x - linestart.x)) based on the x,y values from the map created using 2d. All i see is that the 2d points are successfully converted and i see the same orientation and shape correctly in 3D which is reproduced as rooms using Rectangle and Plane class of papervision3D. But somehow i am not happy with the results coz the perspective(focus and zoom) seems to change based on the arbitrary height values(i guess so) i give while reconstructing the walls from the 2d line values. Where as if i use a 3D modeling program like blender or sketchup to draw the 3D directly then the models are rendered perfectly as visualized and created without any problems. My question here is if we manually add Rectangles and Planes (the primitive objects) to construct a room does not give the feel but where as the model of a room designed in a 3d program is beautifully rendered. Is there any thing that i am missing here? are there any other special properties that comes with a collada that fixes the way our pv3d camera renders the display object? Please help and your suggestions and advices would be appreciated. Regards, Ashok Srinivasan. |
Sounds like a project I'm working towards. I have some experience in
Sketchup/ other 3D programs, and I think I understand you to be saying the viewport you're getting in PV3D isn't satisfying your vision of what a room should look like, given your other program experiences. A couple of things to try: Sketchup uses a basic FOV of 30: "You can adjust the FOV between 1 and 120 degrees (the default is 35 degrees in Google SketchUp and 30 degrees in SketchUp Pro)" To match this is Papervision3D, you want to try adjusting: camera.fov = 30; //try 30 through 60, see if you like it. TO represent buildings in floorplan, you might also like to try: camera.ortho = true; //isometric projection camera.x = -150+sphere.x; //use whatever object you want to centre on. camera.y = 100+sphere.y; camera.z = -150+sphere.z; camera.rotationY = 45; //angle the view 45 degrees on to horizontal. camera.rotationX = 33; //tilt down See if that helps, but let me know if that wasn't what you wanted too. Don Have a great day -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of aalavandhaann Sent: Friday, 12 November 2010 7:34 AM To: [hidden email] Subject: [Papervision3D] Advice needed!! thanks in advance. Dear Pv3D gurus, All this while i have been trying to make a 2d editor which will help me to draw maps by just drawing lines around in the 2d screen for the walls and other library items which has an equivalent 3d representation for a FPS based game. Then i take those line starting and end point values and construct them as 3D walls using rectangles/planes by deciphering the x,y,z and rotational values mathematically( just by applying 2d y value as z value in 3d. The height of the wall is arbitrarily chosen. The rotation value is calculated using Math.atan2(lineend.y - linestart.y,lineend.x - linestart.x)) based on the x,y values from the map created using 2d. All i see is that the 2d points are successfully converted and i see the same orientation and shape correctly in 3D which is reproduced as rooms using Rectangle and Plane class of papervision3D. But somehow i am not happy with the results coz the perspective(focus and zoom) seems to change based on the arbitrary height values(i guess so) i give while reconstructing the walls from the 2d line values. Where as if i use a 3D modeling program like blender or sketchup to draw the 3D directly then the models are rendered perfectly as visualized and created without any problems. My question here is if we manually add Rectangles and Planes (the primitive objects) to construct a room does not give the feel but where as the model of a room designed in a 3d program is beautifully rendered. Is there any thing that i am missing here? are there any other special properties that comes with a collada that fixes the way our pv3d camera renders the display object? Please help and your suggestions and advices would be appreciated. Regards, Ashok Srinivasan. -- View this message in context: http://papervision3d.758870.n4.nabble.com/Advice-needed-thanks-in-advance-tp 3038514p3038514.html Sent from the Papervision3D mailing list archive at Nabble.com. _______________________________________________ Papervision3D mailing list [hidden email] http://osflash.org/mailman/listinfo/papervision3d_osflash.org _______________________________________________ Papervision3D mailing list [hidden email] http://osflash.org/mailman/listinfo/papervision3d_osflash.org |
Hello Don,
First of all a big thanks to you for having taken your time to read my post. Coming to the issue i was talking about, i guess i have not made it clear. I was actually talking about comparison between room models loaded and rendered in pv3d versus room models created using primitives and rendered in pv3d. Rest about the problem is what i have explained in my first post. Since this is an utility for a FPS based working model, i am not trying to achieve ISOmetry here. But still from what u wrote i find it interesting and will maybe use it in future. I will try to post some pictorial representations to explain this further. But still thanks and thanks for your move to help. Regards, Ashok Srinivasan. |
Ahh I understand better now. Do you have a screenshot or sample in flash we can see? I think the only thing collada brings in is materials, but these should be similar, and reproducible (except pre-rendered lighting).
Don Have a great day On 12/11/2010, at 6:07 PM, aalavandhaann <[hidden email]> wrote: > > Hello Don, > > First of all a big thanks to you for having taken your time to read my post. > Coming to the issue i was talking about, i guess i have not made it clear. I > was actually talking about comparison between room models loaded and > rendered in pv3d versus room models created using primitives and rendered in > pv3d. Rest about the problem is what i have explained in my first post. > > Since this is an utility for a FPS based working model, i am not trying to > achieve ISOmetry here. But still from what u wrote i find it interesting and > will maybe use it in future. I will try to post some pictorial > representations to explain this further. But still thanks and thanks for > your move to help. > > Regards, > > Ashok Srinivasan. > > > -- > View this message in context: http://papervision3d.758870.n4.nabble.com/Advice-needed-thanks-in-advance-tp3038514p3039142.html > Sent from the Papervision3D mailing list archive at Nabble.com. > > _______________________________________________ > Papervision3D mailing list > [hidden email] > http://osflash.org/mailman/listinfo/papervision3d_osflash.org _______________________________________________ Papervision3D mailing list [hidden email] http://osflash.org/mailman/listinfo/papervision3d_osflash.org |
I'm working with a camera in .ortho mode, and looking down at an angle of
about 30 degrees. I have a basic grid of boxes as a floor, and a player moving around. My beautiful isometric camera follows the player but remains at the same angle, so the player is always centred. Unfortunately, as the camera moves forward in space, it starts to see grid squares that are "behind the camera plane" and yet they don't render (bottom of my viewport is missing squares/ triangles) I believe it isn't actually frustrum culling, but the vertex3D points actually start to be impossible for the ortho camera to Project (behind camera, they get set as .visible = false) Has anyone ever used ortho, and found a good solution? I'm almost going to use a long zoom on a perspective camera... :/ (the alternative I thought of, is to rotate the world 30 degrees up, and leave the camera looking straight on, but I want multiple viewports, and this will make for some pain...) Don Have a great day _______________________________________________ Papervision3D mailing list [hidden email] http://osflash.org/mailman/listinfo/papervision3d_osflash.org |
> vertex3D points
> actually start to be impossible for the ortho camera to Project (behind > camera, they get set as .visible = false) why not move camera far, far away? _______________________________________________ Papervision3D mailing list [hidden email] http://osflash.org/mailman/listinfo/papervision3d_osflash.org |
In reply to this post by aalavandhaann
As said i am now attaching the pictorial representation. If you notice carefully each wall is a plane with color material applied to it(though the color is at random). The walls are constructed based on the width and the height calculated using an XML. This XML is generated by another flash tool done by me which will enable to user to just draw the rooms for the map in 2d. Then i load the xml in my 3d viewer which will read all the points of a room and then construct the room with its walls.
example : <gamemap version="0.0.1"><room><points><point><x>190</x><y>148</y></point><point><x>383</x><y>148</y></point><point><x>383</x><y>351</y></point><point><x>190</x><y>351</y></point></points></room><room><points><point><x>383</x><y>148</y></point><point><x>624</x><y>148</y></point><point><x>624</x><y>446</y></point><point><x>624</x><y>485</y></point><point><x>383</x><y>485</y></point><point><x>383</x><y>351</y></point></points></room><room><points><point><x>624</x><y>148</y></point><point><x>831</x><y>148</y></point><point><x>831</x><y>446</y></point><point><x>624</x><y>446</y></point></points></room><room><points><point><x>190</x><y>351</y></point><point><x>383</x><y>351</y></point><point><x>383</x><y>485</y></point><point><x>383</x><y>620</y></point><point><x>190</x><y>620</y></point></points></room><room><points><point><x>624</x><y>446</y></point><point><x>831</x><y>446</y></point><point><x>831</x><y>622</y></point><point><x>624</x><y>622</y></point><point><x>624</x><y>485</y></point></points></room></gamemap> if you notice the above XML the structure contains three rooms and each room tag contains the points information. Using this i reconstruct the rooms in 3D calculating the width by finding the distance between two points. For height i use an arbitrary value. Only at this point the problem starts. When i set the height of each walls(a primitive plane) to be 200 units everything looks fine. in fact i am quite happy with the output. Now i wanted to increase the height of the planes to 700 units, then scene the way being rendered changes. This can be figured out if you compare the distance from the camera to the walls in bot the versions. You will get a fair idea when u look at the pictures. The names of the picture will give u the idea about the height value of the planes used. Why is the rendering changed based on the size of the objects inside???? Uploaded with ImageShack.us Uploaded with ImageShack.us |
Ok, after a quick play:
- you seem to have the camera height at 0, with the planes created halfway above and below that level. When your 200 height one comes in, the camera height is 100 above "floor level" (the bottom of the planes) which looks fine, and pretty close to what the eye would expect. When your 700 height comes in, the camera is 350 above "floor level", so still halfway up, and it looks like you're in a much smaller room. The differences in points distance from centre, is because they are different distances from the camera, so you get slightly different bends with perspective. Eesh - i'm bad at explaining,... What I'd suggest trying, is move planes up the y-axis so they all sit at the same level, and try a camera height of 100. If that doesn't look better, I'm probably not the man to help, unless someone wants to teach me communication skills. (I really hope that helps) Don Have a great day -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of aalavandhaann Sent: Saturday, 13 November 2010 6:05 AM To: [hidden email] Subject: Re: [Papervision3D] Advice needed!! thanks in advance. As said i am now attaching the pictorial representation. If you notice carefully each wall is a plane with color material applied to it(though the color is at random). The walls are constructed based on the width and the height calculated using an XML. This XML is generated by another flash tool done by me which will enable to user to just draw the rooms for the map in 2d. Then i load the xml in my 3d viewer which will read all the points of a room and then construct the room with its walls. example : <gamemap version="0.0.1"><room><points><point><x>190</x><y>148</y></point><point><x>3 83</x><y>148</y></point><point><x>383</x><y>351</y></point><point><x>190</x> <y>351</y></point></points></room><room><points><point><x>383</x><y>148</y>< /point><point><x>624</x><y>148</y></point><point><x>624</x><y>446</y></point ><point><x>624</x><y>485</y></point><point><x>383</x><y>485</y></point><poin t><x>383</x><y>351</y></point></points></room><room><points><point><x>624</x ><y>148</y></point><point><x>831</x><y>148</y></point><point><x>831</x><y>44 6</y></point><point><x>624</x><y>446</y></point></points></room><room><point s><point><x>190</x><y>351</y></point><point><x>383</x><y>351</y></point><poi nt><x>383</x><y>485</y></point><point><x>383</x><y>620</y></point><point><x> 190</x><y>620</y></point></points></room><room><points><point><x>624</x><y>4 46</y></point><point><x>831</x><y>446</y></point><point><x>831</x><y>622</y> </point><point><x>624</x><y>622</y></point><point><x>624</x><y>485</y></poin t></points></room></gamemap> if you notice the above XML the structure contains three rooms and each room tag contains the points information. Using this i reconstruct the rooms in 3D calculating the width by finding the distance between two points. For height i use an arbitrary value. Only at this point the problem starts. When i set the height of each walls(a primitive plane) to be 200 units everything looks fine. in fact i am quite happy with the output. Now i wanted to increase the height of the planes to 700 units, then scene the way being rendered changes. This can be figured out if you compare the distance from the camera to the walls in bot the versions. You will get a fair idea when u look at the pictures. The names of the picture will give u the idea about the height value of the planes used. Why is the rendering changed based on the size of the objects inside???? http://img585.imageshack.us/i/planeheight200.png/ http://img585.imageshack.us/img585/3725/planeheight200.th.png Uploaded with http://imageshack.us ImageShack.us http://img98.imageshack.us/i/planeheight700.png/ http://img98.imageshack.us/img98/5662/planeheight700.th.png Uploaded with http://imageshack.us ImageShack.us -- View this message in context: http://papervision3d.758870.n4.nabble.com/Advice-needed-thanks-in-advance-tp 3038514p3040162.html Sent from the Papervision3D mailing list archive at Nabble.com. _______________________________________________ Papervision3D mailing list [hidden email] http://osflash.org/mailman/listinfo/papervision3d_osflash.org _______________________________________________ Papervision3D mailing list [hidden email] http://osflash.org/mailman/listinfo/papervision3d_osflash.org |
In reply to this post by makc
Thanks - that does seem to be the solution.
Don Have a great day -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Makc Sent: Saturday, 13 November 2010 4:06 AM To: [hidden email] Subject: Re: [Papervision3D] Ortho projection matrix - bug? > vertex3D points > actually start to be impossible for the ortho camera to Project (behind > camera, they get set as .visible = false) why not move camera far, far away? _______________________________________________ Papervision3D mailing list [hidden email] http://osflash.org/mailman/listinfo/papervision3d_osflash.org _______________________________________________ Papervision3D mailing list [hidden email] http://osflash.org/mailman/listinfo/papervision3d_osflash.org |
In reply to this post by Don Bloomfield
Hello Don,
First of all Thanks to you for having been with me all this time. As per the problem i was facing with the drawing of the 3D model using primitives, where the rooms started to getting small as i started to increase the wall heights, is also happening with the collada models too. All this time i never tried the same thing with collada. Maybe i was a bit lazy or overconfident that the problem would not occur with collada models. Instead i was thinking the model though irrespective of the wall height would be rendered as i expected. But today i took the step of designing the model with sketchup and raise the walls height and lo what i saw completely disappointed me. Even the collada model if increased with the walls height seems to render the room a smaller one. I guess i am missing something here to understand. Regards, Ashok Srinivasan. |
Free forum by Nabble | Edit this page |