It is currently Mon Sep 23, 2019 1:48 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: 3D challenge for a special rotation
PostPosted: Tue Mar 05, 2019 3:28 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4578
Location: Spa, relaxing and thinking, and learning...
Purpose of a 3D challenge.
Just get the executeable (put first the 'Engine3D.dll' in the system directory or in the same dir than the executeable)

After run it, you can see an object (Entity) which can be rotated using mouse movements, and the rotation of the entity is such that it rotates in the same direction as the mouse movements.

Now, while pushing left-control key and moving mouse, the camera orbitates around the object in the world.

Again, pop the left-control key and you can see ALWAYS the object rotates in the same direction as the mouse movements, nevertheless the camera looking vector is.

The issue seems trivial. So, I don't give you any code, just try to do with your own code; will see the triviality of it :twisted:

By the way, I have not seen any 3D CAD-CAM program which do that: at least Catia, Solidworks, Inventor, Cinema4D, Blender, Rhinoceros, Sketchup, AutoCAD do not it. Why? I don't know.
windows 32bit : https://www.dropbox.com/s/hels4zqy29y16 ... tation.exe
windows 64bit : https://www.dropbox.com/s/55ru9ynhm9376 ... nwin64.exe

_________________
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend


Last edited by Psychophanta on Mon Mar 11, 2019 8:37 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: 3D challenge for a special rotation
PostPosted: Tue Mar 05, 2019 7:58 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2011 3:47 am
Posts: 2213
Location: Singapore
Just for the fun of it, my very first 3D code, cobbled together from the samples.
Code:
Define keyX.f, mouseX.f, wFlags = #PB_Window_SystemMenu | #PB_Window_ScreenCentered,
       keys$ = "Mouse & Left/Right Arrows to move - Spacebar to stop - ESC to quit"

If InitEngine3D() And InitSprite() And InitKeyboard() And InitMouse() And
   OpenWindow(0, 0, 0, 800, 600, "3D Challenge - " + keys$, wFlags) And
   OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 0, 0, 0)   
 
  KeyboardMode(#PB_Keyboard_International)
 
  Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Textures", #PB_3DArchive_FileSystem)
  Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Packs/desert.zip", #PB_3DArchive_Zip)           
 
  CreateSphere(0, 9)
  CreateMaterial(0, TextureID(LoadTexture(#PB_Any, "glass.png")))           
  CreateEntity(0, MeshID(0), MaterialID(0), 0, 0, -10)
  CreateLight(0, RGB(150, 200, 200), 200, 200, 200)
  AmbientColor(RGB(220, 30, 30))     
  SkyBox("desert07.jpg")
  CreateCamera(0, 0, 0, 100, 100)
  MoveCamera(0, 0, 0, 50, #PB_Absolute)
 
  Repeat
   
    Repeat
      event = WindowEvent()
      Select event
        Case #PB_Event_CloseWindow
          appQuit = 1
      EndSelect     
    Until event = 0
       
    If ExamineMouse()           
      lastMouseX = mouseX
      mouseX = -MouseDeltaX() * 0.5 * 0.05
      If mouseX <> lastMouseX
        keyX = 0
        MoveCamera(0, mouseX, 0, 0)
        RotateCamera(0, 0, mouseX, 0, #PB_Relative)
      EndIf     
    EndIf
   
    If ExamineKeyboard()       
      If KeyboardPushed(#PB_Key_Left)
        keyX = -0.5
      ElseIf KeyboardPushed(#PB_Key_Right)
        keyX = 0.5
      ElseIf KeyboardPushed(#PB_Key_Space)
        keyX = 0
      ElseIf KeyboardPushed(#PB_Key_Escape)
        appQuit = 1
      EndIf         
      MoveCamera(0, keyX, 0, 0)
      RotateCamera(0, 0, keyX, 0, #PB_Relative)             
    EndIf   
   
    RenderWorld()
    FlipBuffers()
   
  Until appQuit     
EndIf
Educational, to say the least; but most of all, fun! :lol:

_________________
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D challenge for a special rotation
PostPosted: Wed Mar 06, 2019 11:05 am 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4578
Location: Spa, relaxing and thinking, and learning...
Welcome to 3D world !
Walk more inside and then will see 3D programming is not much to do with other programming. :wink:

_________________
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D challenge for a special rotation
PostPosted: Wed Mar 06, 2019 11:24 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2011 3:47 am
Posts: 2213
Location: Singapore
Psychophanta wrote:
...3D programming is not much to do with other programming. :wink:
Very true. Everything's handled by the rendering engine; we're basically scripting. Testing out the various examples in the 3D folder was a real eye-opener; demystifying!

_________________
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D challenge for a special rotation
PostPosted: Wed Mar 06, 2019 2:17 pm 
Offline
New User
New User

Joined: Thu Jan 18, 2018 11:54 pm
Posts: 9
Hello,

I have copied the Engine3D.dll in the same dir than the executable, and I still have the message "the 3D engine can't be initialized".


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D challenge for a special rotation
PostPosted: Wed Mar 06, 2019 2:26 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2011 3:47 am
Posts: 2213
Location: Singapore
ymerdy wrote:
I have copied the Engine3D.dll in the same dir than the executable, and I still have the message "the 3D engine can't be initialized".

Which example are you trying to run? And does it work in the PureBasic IDE?

_________________
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D challenge for a special rotation
PostPosted: Wed Mar 06, 2019 5:10 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4578
Location: Spa, relaxing and thinking, and learning...
ymerdy wrote:
Hello,

I have copied the Engine3D.dll in the same dir than the executable, and I still have the message "the 3D engine can't be initialized".

Must be the 'Engine3D.dll' file you find inside "C:\programfiles\PureBasic5.70\Compilers".
'Engine3D.dll' 5.70 PB version.

_________________
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D challenge for a special rotation
PostPosted: Thu Mar 07, 2019 2:23 pm 
Offline
New User
New User

Joined: Thu Jan 18, 2018 11:54 pm
Posts: 9
Hello,

yes, that's what I did, I copied the dll from PB 5.70 version, but the exe don't start...


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D challenge for a special rotation
PostPosted: Thu Mar 07, 2019 6:50 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4578
Location: Spa, relaxing and thinking, and learning...
ymerdy wrote:
Hello,

yes, that's what I did, I copied the dll from PB 5.70 version, but the exe don't start...

That is very strange, but sure there is something wrong, i can not help you, sorry.

_________________
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D challenge for a special rotation
PostPosted: Fri Mar 08, 2019 12:02 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1792
Location: Pas-de-Calais, France
Psychophanta wrote:
ymerdy wrote:
Hello,

yes, that's what I did, I copied the dll from PB 5.70 version, but the exe don't start...

That is very strange, but sure there is something wrong, i can not help you, sorry.

Needs x86 version, not x64.


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D challenge for a special rotation
PostPosted: Mon Mar 11, 2019 1:54 pm 
Offline
New User
New User

Joined: Thu Jan 18, 2018 11:54 pm
Posts: 9
OK, with x86 version, it works
Thanx!


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D challenge for a special rotation
PostPosted: Mon Mar 11, 2019 2:53 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 22, 2003 7:43 pm
Posts: 426
Location: Germany, Saarbrücken
Why are they still people using the 32 bit versions? This is old stuff, use it only if there is no other way.

_________________
Electronics, Crazy & Interesting Stuff, all that with text, image and sound? Click here!

The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D challenge for a special rotation
PostPosted: Mon Mar 11, 2019 8:31 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4578
Location: Spa, relaxing and thinking, and learning...
NicTheQuick wrote:
Why are they still people using the 32 bit versions? This is old stuff, use it only if there is no other way.

:lol:
Sorry, I work with linux 64bit and XP 32bit.
XP is much faster than 7, 8.1 and 10. I don't support a OS slower than myself.
That IS a true, so my OS is XP and linux, because i use computer to produce.

But you are right, most people use 64bit. So uploaded win64 bit in first post.

_________________
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D challenge for a special rotation
PostPosted: Tue Mar 12, 2019 12:53 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 22, 2003 7:43 pm
Posts: 426
Location: Germany, Saarbrücken
If you are still using XP you've got much more problems than a slow machine. Kill it with fire, upgrade to Windows 7 or 10 or delete it completely to switch to Linux. But don't use operating systems with security holes and old encryption techniques in combination with internet. As a programmer you should know what that means. Hopefully...

_________________
Electronics, Crazy & Interesting Stuff, all that with text, image and sound? Click here!

The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D challenge for a special rotation
PostPosted: Tue Mar 12, 2019 1:22 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4578
Location: Spa, relaxing and thinking, and learning...
NicTheQuick wrote:
If you are still using XP you've got much more problems than a slow machine. Kill it with fire, upgrade to Windows 7 or 10 or delete it completely to switch to Linux. But don't use operating systems with security holes and old encryption techniques in combination with internet. As a programmer you should know what that means. Hopefully...

This is full off topic.
Well I use it since 2003, with no antivirus never, with no problems.

Windows 7, 8 and 10 are virus itselves, and a undefined amount of lacks , slowing , and problems.
The first thing i got very scared was this simple example:
In a spanish installation of 7, 8, 8.1, or 10, in C: (system partition) there is not appear a folder named "Program files", however system does not allow to create a folder named "Program files".
This fact is just a sympthom the entire system IS A VIRUS.

_________________
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye