BBC BASIC
« 3D EDITOR (merged into 1 screen) »

Welcome Guest. Please Login or Register.
Jan 20th, 2018, 4:19pm


Cross-platform BBC BASIC (Win32, Linux x86, Android, Mac OS-X, Raspberry Pi)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: 3D EDITOR (merged into 1 screen)  (Read 170 times)
michael
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 141
xx 3D EDITOR (merged into 1 screen)
« Thread started on: Sep 25th, 2017, 05:44am »

UPDATE: 3DEDITOR MERGED.bbc

Here is the simple link to the merged 3Deditor and Renderer:

https://1drv.ms/u/s!AmYwmTjbmULXljwnAKY9-VYCt23Y

The above link will make it more stable and instant updates of renderer.

REMEMBER: The default triangle is on its side, so the top is on the lower right of the triangle. AND there are 12 triangles stacked, so you will have lots to play with.


So far, none of the issues from the other alternative are a problem and it can work on its own.

IMPORTANT:

LEFT MOUSE BUTTON is for editor controls

RIGHT MOUSE BUTTON is for renderer x and y rotation. (life gets easy !!)


************ THE OTHER ALTERNATIVE **********
This is the less stable alternative:

NOTE: I will make it so you can save the layout in a special file so you can load the mesh and apply a texture or color. I may make a program generator for that too. (maybe)

You will need to put these programs in your downloads
at:
C:Users\liber\Downloads\bbcsdl20\examples\

IF you choose to have the programs elsewhere you will need to change this line in 3D proj.BBC after line 90:
PROCexecute("C:\Users\liber\Downloads\bbcsdl20\examples\RENDERER", "") :REM you may need to change this

Here is the link to the programs:

https://1drv.ms/f/s!AmYwmTjbmULXljuOuhd5nzD_wKaC

Once the files are placed in the directory 3D proj.BBC will be able to find RENDER.BBC and execute it.

So lets get started:

LOAD 3D proj.BBC into BBC4W.
Execute it
Another black window will open.
Drag it to the right of the editor

Left mouse click the center of the black empty screen and a triangle should appear.

NOTE: try not to rotate the triangles too much at one time, so as to not cause a failed read or write. (I will error trap that later)

Now notice if you hold your left mouse button down and move it around the renderer the image will rotate in different directions (you control that)

** Also you must use your left mouse button to update the renderer after you do modifications in the editor window. **

NOTE: make sure you choose a triangle (1 - 12)

I will make a video later to show it in action.

NOTE: The editor has movement distance controls .
0.01 and 0.5 and 1

Also, after you make a 3D image you should rename the FVF output file, as it will reset the data if you restart the editor
The BBCSDL version is still being worked on.


« Last Edit: Sep 25th, 2017, 7:53pm by michael » User IP Logged

I like reinventing the wheel, but for now I will work on tools for D3D
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 689
xx Re: 3D EDITOR (merged into 1 screen)
« Reply #1 on: Sep 25th, 2017, 9:46pm »

on Sep 25th, 2017, 05:44am, michael wrote:
Here is the simple link to the merged 3Deditor and Renderer

Just to repeat what I said before: it isn't desirable to attempt to merge the '3D editor' and the 'renderer' in a single .BBC program. That can't work in BBCSDL (you cannot mix OpenGL and conventional graphics in the same window) so any such 'merged' approach is doomed never to be cross-platform compatible.

Another important reason why it is preferable to run the editor and renderer in separate processes is that it makes (much) better use of the resources available in a multi-core CPU, therefore it should run faster and smoother. I also think it is valuable to be able to minimise and resize the two windows independently.

If you look at SDLIDE (my IDE for the desktop editions of BBCSDL) you will see that it adopts this 'multi process' approach extensively. Not only is the user's BASIC program itself run in a separate process from the IDE, but (when debugging) the 'List variables' window is yet another process and so is the profiler's output window.

Even in BB4W the 'Add-ins' available in the IDE's Utilities menu are run as separate processes, so this approach is nothing new.

Richard.
« Last Edit: Sep 25th, 2017, 9:49pm by Richard Russell » User IP Logged

michael
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 141
xx Re: 3D EDITOR (merged into 1 screen)
« Reply #2 on: Sep 25th, 2017, 11:43pm »

Quote:
it isn't desirable to attempt to merge the '3D editor' and the 'renderer' in a single .BBC program.


I agree. The merged version is only temporary and I am using it to work out controlling all the triangles.

Right now they are individually controlled. I want to be able to link them at a moments notice..(move multiple objects together.

So my next approach is to create radio buttons to activate and deactivate triangles.

When that is worked out I will port the components back.

The current obstacle I have with the two programs is syncing the file access. Although I have the idea of how to fix it, I need to get the editor toys ironed out.

Also I encountered another obstacle. I will provide a link once I prepare it.


User IP Logged

I like reinventing the wheel, but for now I will work on tools for D3D
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 689
xx Re: 3D EDITOR (merged into 1 screen)
« Reply #3 on: Sep 26th, 2017, 01:11am »

on Sep 25th, 2017, 11:43pm, michael wrote:
The current obstacle I have with the two programs is syncing the file access.

It can be tricky, and even more so because the file sharing behaviour is different between Windows and Linux. Only today I discovered a minor problem with the BBCSDL 'List Variables' debugging feature when running in Linux, for this very reason.

To expand on a previous reply, here are some things you can do to mitigate any problems:
  1. Whenever you try to open a file, be prepared for it to fail (a returned channel number of zero). In that case wait a little while - waiting for a 'random' time will help avoid a deadlock - and attempt the open again.

  2. Use OPENOUT only once, to initially create the file. Thereafter, whenever you want to modify the file, use OPENUP rather than OPENOUT. This will ensure that the file's contents don't momentarily 'disappear' each time you update it.

  3. When modifying an FVF file, update the header 'intelligently'. If you are lengthening the file update the header after you have added the extra records; if you are shortening the file update the header before you delete the unwanted records. This will help ensure that at all times the contents of the file are valid.
Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!


This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls