Page 3 of 9 FirstFirst 12345 ... LastLast
Results 21 to 30 of 82

Thread: Is OBJ or 3ds export possible ?

  1. #21
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732

    Re: Is OBJ or 3ds export possible ?

    Hi Macros,

    nice surprise, good progress!

    Few hints to "make it work":

    - use TBGL_m15InitModelBuffers 1, 10000 just once in program initialisation ( right after binding canvas )

    - use TBGL_m15SetVertexTexN( <model>, 1, <vertexcount>, <textureID>) to set texture, m15 buffers are isolated objects not reacting on TBGL_BindTexture

    - use TBGL_m15SetVertexRGB( <model>, 1, <vertexcount>, <R>, <G>, <B>) to set color, must be other than black else texture will not be visible ( 255, 255, 255 ) recommended


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  2. #22

    Re: Is OBJ or 3ds export possible ?

    Thanks for the tips
    have got the textures applied and they change alright but the scaling is wierd.

    Textures seem to be scaled really large so that they sort of just display as colours,No Detail.
    cannot seem to get the coordinates right.

    Should i be using TBGL_TEXCOORD2D at all or should i be setting the textures up using .M15 commands ?

    The problem with the leaves still remains.
    It seems like the texture for the branches overrides the leaves texture.
    Any ideas as to what could be causing this ?

    the scripts attached

    Many thanks for all the help that you have given me already.


    Attached Files Attached Files

  3. #23
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732

    Re: Is OBJ or 3ds export possible ?

    Hi Macros,

    good, the problem with texture coordinates is in fact you do not specify any.

    Use TBGL_m15SetVertexTexXY in the same way you would TBGL_TexCoord2D - that means for each vertex.
    You can extract the proper coordinates from the first cylinder code I posted earlier in this thread ( that non M15 ).

    Leaf textures override - will check.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #24

    Re: Is OBJ or 3ds export possible ?

    I have posted the script i am working with (just the cylinder).
    I would just like to know if i am heading in the right direction with the texture coords.
    Not sure if i am assigning the right values to the right vertices.
    The script does run but no textures are displayed.

    Scripting X,Y coords isnt difficult as i understand the basics, like where 1,1 would have me landing in x,y coords when assigning TBGL_M15SETVERTEXTEXXY to a cube (made from same technique as the .M15 cylinder), but when it comes to mapping around a cylinder i am a bit lost.
    I know its something to to with the radius and hieght values but as i am new to scripting this kind of thing it is quite confusing.

    I think its important to say now that first and foremost i am a 3D modeling and texture artist that has learnt using 3ds max.
    This is why i am having difficulty with the texturing aspect (being a 3ds max user i am used to just assigning uv map and applying material). Scripting is something i have just started to explore in more depth and while i understand a lot of whats going on i get lost in the math sometimes.(maybe need to refresh what i know and probably learn more)

    I have worked with darkbasic for a little while and also other game creation engines such as Gamestudio A7,Irlicht,OGRE and
    so on, but mainly as modeller and texture artist with very limited need for scripting.
    Not that i didnt have to do any scripting but the things i had to script where always very simple.

    While these are good they dont really suite the kind of developments i want to undertake, this is my reason for being so interested in Thinbasic and TBGL.
    I have a pretty good understanding of scripting the windows UI and controls and the fact that they can be used so easily to control the TBGL scene is a big plus.
    I can only see a bright future for Thinbasic and TBGL.

    Attached Files Attached Files

  5. #25
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732

    Re: Is OBJ or 3ds export possible ?

    Macros,

    thanks for your kind words.

    I just returned from Uni, will check your code.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  6. #26
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732

    Re: Is OBJ or 3ds export possible ?

    Hi,

    I found the reasons for troubles, there were 2:
    - using TBGL_m15SetVertexTexN( 1, 1, vertexIndex, 1 ) on the start is not good, as vertexIndex is 0 in that part
    - other problem was in fact you set just one coordinate for each vertex, forgetting the second. I used 3DS Max only for 30 days (trial version), but I think this texture coordinates are called UV there. So you set just U and not V.

    - I corrected problem with different radiuses ignored by cylinder

    To save few polys maybe you could render just sides, not bases, that's up to you of course.


    Petr

    Attached Files Attached Files
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  7. #27

    Re: Is OBJ or 3ds export possible ?

    Ok .M15 cylinder works.
    .M15 Cylinder Textures work.

    Still having problems with the leaves.

    The script is attached.

    I have scripted a polygon using .M15 commands to use for the leaves but cant get it to work.
    The script seems to be right but the created polygon is not displayed.
    The script for the polygon is in the attached script but it is not being used at the moment.


    I have read over your description of how TBGL geometry works and have a question.

    If using the original code is it possible to export the leaves that are created via TBGL_BEGINPOLY if they are part of a display list.
    This way i will not have to change much, otherwise i will keep trying to get the .M15 polygon to work.

    ------------------------------------------------------------------------------------------------------------------------------------------

    Lightning v1

    I have also been working on a script to create lightning using %GL_LINE_STRIP and vertex coordinates.
    Not very complex at the moment but i will post script so you can see what i have created so far.
    The lightning works alright but i need to sort out timing issues.
    Currently you can call a lightning bolt by pressing 2 but it is still under development so it doesnt work properly yet.
    The biggest trouble is that it creates more than one lightning bolt.
    I know this is something to do with how i have made the lightning.
    When it is called i want just one bolt but i have to spend more time to get this right.
    The final script will have the lightning being called at random start positions at cloud level and targeting random position on the ground or terrain.

    There is also was bit of lag on the glow effect i have used but this isnt really important at the moment.
    I will probably try using Shaders to get the lightning to glow correctly.
    I read somewhere that TBGL can use Nvidia FX composer shaders.
    I know enough to get a good glow happening in FX composer so it would be handy to be able to use the FX file.
    What type of FX files are compatible with TBGL as you can output a few different types of FX file from FX composer ?
    Attached Files Attached Files

  8. #28
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732

    Re: Is OBJ or 3ds export possible ?

    Hi Macros,

    nice code!

    I need to put one thing straight - there is no "autoexport" for any of TBGL geometry, so it all depends on how you design it.

    Problem with Dleaf was in 2 things:
    - you use TBGL_m15InitModelBuffers to define space for 1 model slot, while you define leaf in second
    - little mistake in TBGL_m15SetVertexTexN set texture only to last vertex
    - not increasing vertexIndex caused placing new vertices at invalid item of 0

    Regarding lightnings - cool stuff!
    Just one thing - could you create new thread for them, so this would be for trees and another for lightnings?

    Glow can be implemented even with pure render2texture, I did it multiple times and posted samples here.
    Info on rendering to texture is in ThinBasic Journal 2 article about motion blur.

    Regarding CG shaders, yes it is possible:
    http://community.thinbasic.com/index.php?topic=1708.0
    ... but did not tested it too much.


    I attach new code for you,
    Petr


    Attached Files Attached Files
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  9. #29
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,782
    Rep Power
    10

    Re: Is OBJ or 3ds export possible ?

    Macros,

    maybe you already know but worth to mention: we have a download section called "thinBasic Bonus Packs" at http://www.thinbasic.com/index.php?o...tegory&catid=5
    You will find there 2 downloads with tons of TBGL example. Maybe you will find new features and get even more inspirations.

    Thanks a lot for your nice scripts.
    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  10. #30

    Re: Is OBJ or 3ds export possible ?

    Thanks for that Petr

    But without your help i would still be trying to make a cylinder.

    So now that everything is defined using .M15 commands i will be able to export to OBJ via custom export script is that right ?

    There is still a lot of work i have to do on textures for the branches and leaves (i intend to include a larger library of textures)
    as well as completing UI and controls for tree definition.

    I have already got the basics done on the UI and know how to link all the Values to be adjusted.(A lot easier than expected)

    I will also include controls to choose which textures are used for branches and leaves instead of leaving them random.

    Just a quick thought.
    When i mentioned doing the tree's with continous mesh it got me thinking.

    All the vertices for the cylinders are defined by .M15 commands.

    When the tree is generated could the data for the tree (branches) be evaluated and used
    to create (generate) continous mesh from the vertices that is then displayed instead of the cylinders ?

    I am not sure if this is possible but it sounds good in theory.

    I will make a new post for the Lightning script but it is still really basic and
    there is not much in way of controlling it.

    Well now the artistic side of things needs some attention , many hours of working on photos with Gimp to get Texture library done. (really just need a short break from looking at scripting)
    ------------------------------------------------------------------------------------------------------------------------------------------------------

    Eros

    Thanks for the pointer.
    I have downloaded the bonus packs and have been looking over them as i have been working on the tree generator.
    Also thanks for the kind words about my scripts but a lot of credit has to go to Petr as he has basically guided me through it.
    The Lightning script is my first attempt at scripting with no help.

    ------------------------------------------------------------------------------------------------------------------------------------------------------

Page 3 of 9 FirstFirst 12345 ... LastLast

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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