Results 1 to 9 of 9

Thread: 3D models

  1. #1
    asdfg is offline Senior Member
    Join Date
    Nov 2016
    Posts
    163
    Rep Power
    2

    Default 3D models

    Is it possible to create 3D models and use them within FX application?
    There is default figures like: cilinre, square... It is primite.

    If I would create 3D model with some kind of program, could I import it to FX applications and use/rotate/etc...

    For example I can import images:
    Java FX Code:
    Image img = new Image ():
    Perhaps there is some advices with item collision too?

    I currently see only Jmonkey for my plans.


    ALso how about ogre4j ? its graphic rendering engine - I quess.
    Last edited by asdfg; 08-02-2017 at 12:11 AM.

  2. #2
    benji2505 is offline Senior Member
    Join Date
    Sep 2014
    Location
    MA, USA
    Posts
    387
    Rep Power
    4

    Default Re: 3D models

    Yes, it is possible to create 3D objects in JavaFX. Image and square are 2D models though, in 3D lingo you have box, cube, pyramide, ball, etc.. There are a few standard 3D shapes available, but you can also define a custom 3D shape, this is called a mesh then. The 3D view is more complicated because you have to define view angle and perspective ("camera").
    It should be doable to calculate collision with 3D objects, but it is mathematically more elaborate.
    As a starting point I would check this and this.
    I have not heard anything about ogre4j so far.

  3. #3
    asdfg is offline Senior Member
    Join Date
    Nov 2016
    Posts
    163
    Rep Power
    2

    Default Re: 3D models

    Doing these mesh figures in FX will take longer, It could be much easier to create model ( lets say in adobe ) and import it in to project, like images and audio.

    Ogre4J is a version of Ogre3D, which is made for C++. Probably will lack of documentation for this counterpart.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    25

    Default Re: 3D models

    Whatever you produce your models in will have a 3D image format.
    Consequently you need a 3D engine that can interpret those models.
    JavaFX, as far as I know, doesn't have such a renderer/engine.

    You'll need to do a bit of research.
    You could start with Blender, if you don't already have a preferred modelling software.
    I can't vouch for this, but here's a Blender tutorial for creating a 3D game asset. There are plenty of others out there.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    benji2505 is offline Senior Member
    Join Date
    Sep 2014
    Location
    MA, USA
    Posts
    387
    Rep Power
    4

    Default Re: 3D models

    It is possible to import custom 3D models into JavaFX. I know for sure it works with stl files, I think it also works with other formats. Here are some useful infos:

    import

    3rd party solution with samples

    Quick intro to JavaFX 3D

    Take some time and watch the video behind the last link. It answers most of your questions.
    Last edited by benji2505; 08-02-2017 at 11:51 AM.

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    25

    Default Re: 3D models

    Well, that is an engine to import.
    FX by itself doesn't come with that.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    benji2505 is offline Senior Member
    Join Date
    Sep 2014
    Location
    MA, USA
    Posts
    387
    Rep Power
    4

    Default Re: 3D models

    True. Using 3rd party libraries for these kind of non-mainstream applications is not unusual, though.

  8. #8
    asdfg is offline Senior Member
    Join Date
    Nov 2016
    Posts
    163
    Rep Power
    2

    Default Re: 3D models

    Im not sure if we understood correct. I actually want to import 3D model and it to be as a node. So I could add it to the group, manipulate ( scale, rotate, addd collision detection and animations).

  9. #9
    benji2505 is offline Senior Member
    Join Date
    Sep 2014
    Location
    MA, USA
    Posts
    387
    Rep Power
    4

    Default Re: 3D models

    scale, rotate: yes
    animation: Never tried it, but I would not see why not
    collision detection: difficult.

Similar Threads

  1. Replies: 2
    Last Post: 01-27-2010, 08:28 AM
  2. Testing EMF models.
    By manik_jforum in forum Eclipse
    Replies: 0
    Last Post: 12-10-2008, 08:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •